예제 #1
0
        /// <summary>
        /// Parses a single term in a comma separated list of things to expand.
        /// </summary>
        /// <returns>A token list representing thing to expand, the expand option star will have more than one items in the list.</returns>
        private List <ExpandTermToken> ParseSingleExpandTerm()
        {
            this.isSelect = false;

            var termParser             = new SelectExpandTermParser(this.lexer, this.MaxPathDepth, this.isSelect);
            PathSegmentToken pathToken = termParser.ParseTerm(allowRef: true);

            string optionsText = null;

            if (this.lexer.CurrentToken.Kind == ExpressionTokenKind.OpenParen)
            {
                optionsText = this.lexer.AdvanceThroughBalancedParentheticalExpression();

                // Move lexer to what is after the parenthesis expression. Now CurrentToken will be the next thing.
                this.lexer.NextToken();
            }

            if (expandOptionParser == null)
            {
                expandOptionParser = new ExpandOptionParser(
                    this.resolver,
                    this.parentEntityType,
                    this.maxRecursiveDepth,
                    this.enableCaseInsensitiveBuiltinIdentifier,
                    this.enableNoDollarQueryOptions)
                {
                    MaxFilterDepth  = MaxFilterDepth,
                    MaxOrderByDepth = MaxOrderByDepth,
                    MaxSearchDepth  = MaxSearchDepth
                };
            }

            return(this.expandOptionParser.BuildExpandTermToken(pathToken, optionsText));
        }
예제 #2
0
        /// <summary>
        /// Parses a single term in a comma separated list of things to select.
        /// </summary>
        /// <returns>A token representing thing to select.</returns>
        private PathSegmentToken ParseSingleSelectTerm()
        {
            this.isSelect = true;

            var termParser = new SelectExpandTermParser(this.lexer, this.MaxPathDepth, this.isSelect);

            return(termParser.ParseTerm());
        }
예제 #3
0
        /// <summary>
        /// Parses a single term in a comma separated list of things to expand.
        /// </summary>
        /// <returns>A token list representing thing to expand, the expand option star will have more than one items in the list.</returns>
        private List <ExpandTermToken> ParseSingleExpandTerm()
        {
            this.isSelect = false;

            var termParser             = new SelectExpandTermParser(this.lexer, this.MaxPathDepth, this.isSelect);
            PathSegmentToken pathToken = termParser.ParseTerm(allowRef: true);

            string optionsText = null;

            if (this.lexer.CurrentToken.Kind == ExpressionTokenKind.OpenParen)
            {
                optionsText = this.lexer.AdvanceThroughBalancedParentheticalExpression();

                // Move lexer to what is after the parenthesis expression. Now CurrentToken will be the next thing.
                this.lexer.NextToken();
            }

            return(this.SelectExpandOptionParser.BuildExpandTermToken(pathToken, optionsText));
        }