public static Doc Print(SelectClauseSyntax node) { return(Doc.Concat( Token.PrintWithSuffix(node.SelectKeyword, " "), Node.Print(node.Expression) )); }
public override void VisitSelectClause(SelectClauseSyntax node) { IncrementNodeCount(2); // direct equivalent of the SQL `SELECT` clause AddOperator("select"); base.VisitSelectClause(node); }
private LuaExpressionSyntax BuildQuerySelect(LuaExpressionSyntax collection, SelectClauseSyntax node, IQueryRangeVariable rangeVariable) { var selectFunction = new LuaFunctionExpressionSyntax(); PushFunction(selectFunction); selectFunction.AddParameter(rangeVariable.Name); var expression = (LuaExpressionSyntax)node.Expression.Accept(this); if (node.Expression.IsKind(SyntaxKind.IdentifierName)) { if (expression is LuaIdentifierNameSyntax identifierName && identifierName.ValueText == rangeVariable.Name.ValueText) { PopFunction(); return(collection); } } selectFunction.AddStatement(new LuaReturnStatementSyntax(expression)); PopFunction(); var type = semanticModel_.GetTypeInfo(node.Expression).Type; var typeExpression = GetTypeName(type); return(new LuaInvocationExpressionSyntax(LuaIdentifierNameSyntax.LinqSelect, collection, selectFunction, typeExpression)); }
private Doc PrintSelectClauseSyntax(SelectClauseSyntax node) { return(Concat( this.PrintSyntaxToken(node.SelectKeyword, " "), this.Print(node.Expression) )); }
private VariableState VisitSelectClause(SelectClauseSyntax selectClauseSyntax, ExecutionState state) { var finalState = new VariableState(selectClauseSyntax, VariableTaint.Unset); foreach (var variable in selectClauseSyntax.Variables) { finalState.MergeTaint(VisitNode(variable, state).Taint); } return(finalState); }
public override void VisitSelectClause(SelectClauseSyntax node) { var paramInfo = m_LinqParamInfoStack.Peek(); var paramNames = paramInfo.ParamNames; CodeBuilder.AppendFormat("select(function({0}){{ return(", string.Join(", ", paramNames.ToArray())); var opd = m_Model.GetOperation(node.Expression) as IConversionExpression; OutputExpressionSyntax(node.Expression, opd); CodeBuilder.Append("); })"); }
public override SyntaxNode VisitSelectClause(SelectClauseSyntax node) { if (!_visitQuerySyntax) { return(base.VisitSelectClause(node)); } var selectExpression = (ExpressionSyntax)SetFlagAndVisit(node.Expression); return(BuildFluentInvocation("Select", BuildSimpleLambdaExpression(selectExpression))); }
public override void VisitSelectClause(SelectClauseSyntax node) { Visit(node.Expression); foreach (string variable in _fromVariables.Where(v => v.Value == _linqIndex).Select(v => v.Key).ToList()) { AddProperties(GetProperties(_variables[variable])); _fromVariables.Remove(variable); _variables.Remove(variable); } _linqIndex--; _proceed = true; }
public override void VisitSelectClause(SelectClauseSyntax node) { if (!PreVisit(node)) { return; } node.Expression?.Accept(this); base.VisitSelectClause(node); PostVisit(node); }
public override void VisitSelectClause(SelectClauseSyntax node) { var paramInfo = m_LinqParamInfoStack.Peek(); var paramNames = paramInfo.ParamNames; string prestr = paramInfo.Prestr; paramInfo.Prestr = ", "; CodeBuilder.AppendFormat("{0}{{\"select\", (function({1}) return ", prestr, string.Join(", ", paramNames.ToArray())); var opd = m_Model.GetOperation(node.Expression) as IConversionExpression; OutputExpressionSyntax(node.Expression, opd); CodeBuilder.Append("; end)}"); }
private LuaExpressionSyntax BuildQuerySelect(LuaExpressionSyntax collection, SelectClauseSyntax node, LuaIdentifierNameSyntax rangeVariable) { var expression = (LuaExpressionSyntax)node.Expression.Accept(this); if (node.Expression.IsKind(SyntaxKind.IdentifierName)) { var identifierName = expression as LuaIdentifierNameSyntax; if (identifierName != null && identifierName.ValueText == rangeVariable.ValueText) { return(collection); } } var type = semanticModel_.GetTypeInfo(node.Expression).Type; var typeExpression = GetTypeName(type); return(new LuaInvocationExpressionSyntax(LuaIdentifierNameSyntax.LinqSelect, collection, expression, typeExpression)); }
public void VisitSelectClause(SelectClauseSyntax node) { if (node == null) { throw new ArgumentNullException("node"); } node.Validate(); if (!_writer.Configuration.LineBreaksAndWrapping.Other.PlaceLinqExpressionOnSingleLine) { _writer.Break(true); } _writer.WriteKeyword(PrinterKeyword.Select); _writer.WriteSpace(); node.Expression.Accept(this); }
public override void VisitSelectClause(SelectClauseSyntax node) { throw new NotImplementedException(); }
public override void VisitSelectClause(SelectClauseSyntax node) { return; }
public override void VisitSelectClause(SelectClauseSyntax node) { node.Expression?.Accept(this); base.VisitSelectClause(node); }
public override void VisitSelectClause(SelectClauseSyntax node) { Log(node, "Unsupported Syntax !"); }
public override void VisitSelectClause(SelectClauseSyntax node) { var saveCurrentScope = currentScope; currentScope = new DeclarationScope(currentScope); Visit(node.Expression); Debug.Assert(currentScope.Parent == saveCurrentScope); currentScope = saveCurrentScope; }
public TameSelectClauseSyntax(SelectClauseSyntax node) { Node = node; AddChildren(); }
public virtual TResult VisitSelectClause(SelectClauseSyntax node) { return(DefaultVisit(node)); }
/// <inheritdoc /> public override Expression VisitSelectClause(SelectClauseSyntax node) { throw Unexpected(node, nameof(VisitQueryExpression)); }
/// <summary> /// /// </summary> /// <param name="node"></param> public override sealed void VisitSelectClause(SelectClauseSyntax node) { this.OnNodeVisited(node); if (!this.traverseRootOnly) base.VisitSelectClause(node); }
public override LuaSyntaxNode VisitSelectClause(SelectClauseSyntax node) { throw new InvalidOperationException(); }
/// <summary> /// /// </summary> /// <param name="node"></param> public override sealed void VisitSelectClause(SelectClauseSyntax node) { this.OnNodeVisited(node, this.type.IsInstanceOfType(node)); base.VisitSelectClause(node); }
public override SyntaxNode VisitSelectClause(SelectClauseSyntax node) { node = (SelectClauseSyntax)base.VisitSelectClause(node); Classes.Add(node); return(node); }
public override void VisitSelectClause(SelectClauseSyntax node) { base.VisitSelectClause(node); }
public override Evaluation VisitSelectClause(SelectClauseSyntax node) { node.Expression?.Accept <Evaluation>(this); return(base.VisitSelectClause(node)); }
public virtual void VisitSelectClause(SelectClauseSyntax node) { DefaultVisit(node); }
public void VisitSelectClause(SelectClauseSyntax node) { if (node == null) throw new ArgumentNullException("node"); node.Validate(); if (!_writer.Configuration.LineBreaksAndWrapping.Other.PlaceLinqExpressionOnSingleLine) _writer.Break(true); _writer.WriteKeyword(PrinterKeyword.Select); _writer.WriteSpace(); node.Expression.Accept(this); }
// // Summary: // Called when the visitor visits a SelectClauseSyntax node. public virtual void VisitSelectClause(SelectClauseSyntax node);