/// <summary> /// Parses a single term in a comma seperated list of things to expand. /// </summary> /// <returns>A token representing thing to expand.</returns> private ExpandTermToken ParseSingleExpandTerm() { this.isSelect = false; var termParser = new SelectExpandTermParser(this.lexer, this.MaxPathDepth, this.isSelect); PathSegmentToken pathToken = termParser.ParseTerm(); 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.maxRecursiveDepth, enableCaseInsensitiveBuiltinIdentifier) { MaxFilterDepth = MaxFilterDepth, MaxOrderByDepth = MaxOrderByDepth, MaxSearchDepth = MaxSearchDepth }; } return(this.expandOptionParser.BuildExpandTermToken(pathToken, optionsText)); }
/// <summary> /// Parses a single term in a comma seperated 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()); }
/// <summary> /// Runs a unit test on SelectExpandTermParser.ParseTerm() for a $expand term, and gives the lexer back for positional verification. /// </summary> private PathSegmentToken ParseExpandTerm(string term, out ExpressionLexer lexer) { lexer = new ExpressionLexer(term, true /*moveToFirstToken*/, true/*useSemicolonDelimiter*/); var parser = new SelectExpandTermParser(lexer, 100 /*maxPathLength*/, false /*isSelect*/); return parser.ParseTerm(); }
/// <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, enableCaseInsensitiveBuiltinIdentifier) { MaxFilterDepth = MaxFilterDepth, MaxOrderByDepth = MaxOrderByDepth, MaxSearchDepth = MaxSearchDepth }; } return this.expandOptionParser.BuildExpandTermToken(pathToken, optionsText); }
/// <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(); }