Ejemplo n.º 1
0
 public virtual void VisitQueryLetClause(QueryLetClause queryLetClause)
 {
     if (ThrowException)
     {
         throw (Exception)CreateException(queryLetClause);
     }
 }
Ejemplo n.º 2
0
 public virtual void VisitQueryLetClause(QueryLetClause queryLetClause)
 {
     if (this.ThrowException)
     {
         throw (System.Exception) this.CreateException(queryLetClause);
     }
 }
Ejemplo n.º 3
0
        public UnifiedElement VisitQueryLetClause(
            QueryLetClause let, object data)
        {
            var ident = UnifiedIdentifier.CreateVariable(let.Identifier);
            var expr  = let.Expression.TryAcceptForExpression(this);

            return(UnifiedLetQuery.Create(ident, expr));
        }
Ejemplo n.º 4
0
        public override object VisitQueryLetClause(QueryLetClause queryExpressionLetClause, object data)
        {
            var generateExpression = GenerateExpression(queryExpressionLetClause.Expression);

            if (generateExpression != null)
            {
                aliasToName[queryExpressionLetClause.Identifier] = generateExpression + ".";
            }
            return(base.VisitQueryLetClause(queryExpressionLetClause, data));
        }
Ejemplo n.º 5
0
        public override object VisitQueryLetClause(QueryLetClause queryLetClause, object data)
        {
            if (SimplifyLetExpression(queryLetClause.Expression) is LambdaExpression)
            {
                var text = QueryParsingUtils.ToText(queryLetClause);
                throw new SecurityException("Let expression cannot contain labmda expressions, but got: " + text);
            }

            return(base.VisitQueryLetClause(queryLetClause, data));
        }
Ejemplo n.º 6
0
        bool TryRemoveTransparentIdentifier(QueryExpression query, QueryFromClause fromClause, QueryExpression innerQuery, Dictionary <string, object> letClauses)
        {
            if (!IsTransparentIdentifier(fromClause.Identifier))
            {
                return(false);
            }
            QuerySelectClause selectClause = innerQuery.Clauses.Last() as QuerySelectClause;
            Match             match        = selectTransparentIdentifierPattern.Match(selectClause);

            if (!match.Success)
            {
                return(false);
            }

            // from * in (from x in ... select new { members of anonymous type }) ...
            // =>
            // from x in ... { let x = ... } ...
            fromClause.Remove();
            selectClause.Remove();
            // Move clauses from innerQuery to query
            QueryClause insertionPos = null;

            foreach (var clause in innerQuery.Clauses)
            {
                query.Clauses.InsertAfter(insertionPos, insertionPos = clause.Detach());
            }

            foreach (var expr in match.Get <Expression>("expr"))
            {
                switch (expr)
                {
                case IdentifierExpression identifier:
                    // nothing to add
                    continue;

                case NamedExpression namedExpression:
                    if (namedExpression.Expression is IdentifierExpression identifierExpression && namedExpression.Name == identifierExpression.Identifier)
                    {
                        letClauses[namedExpression.Name] = identifierExpression.Annotation <ILVariableResolveResult>();
                        continue;
                    }
                    QueryLetClause letClause = new QueryLetClause {
                        Identifier = namedExpression.Name, Expression = namedExpression.Expression.Detach()
                    };
                    var annotation = new LetIdentifierAnnotation();
                    letClause.AddAnnotation(annotation);
                    letClauses[namedExpression.Name] = annotation;
                    query.Clauses.InsertAfter(insertionPos, letClause);
                    break;
                }
            }
            return(true);
        }
Ejemplo n.º 7
0
			public override object Visit (Mono.CSharp.Linq.Let l)
			{
				var result = new QueryLetClause ();
				var location = LocationsBag.GetLocations (l);
				
				result.AddChild (new CSharpTokenNode (Convert (l.Location), "let".Length), QueryLetClause.Roles.Keyword);
				result.AddChild (new Identifier (l.IntoVariable.Name, Convert (l.IntoVariable.Location)), Identifier.Roles.Identifier);
				if (location != null)
					result.AddChild (new CSharpTokenNode (Convert (location [0]), 1), QueryLetClause.Roles.Assign);
				result.AddChild ((Expression)l.Expr.Accept (this), QueryLetClause.Roles.Expression);
				return result;
			}
Ejemplo n.º 8
0
 public StringBuilder VisitQueryLetClause(QueryLetClause queryLetClause, int data)
 {
     throw new ASLException("ASL does not understand LINQ.");
 }
Ejemplo n.º 9
0
			public override object Visit (Mono.CSharp.Linq.Let l)
			{
				var result = new QueryLetClause ();
				var location = LocationsBag.GetLocations (l);
				
				if (location != null)
					result.AddChild (new CSharpTokenNode (Convert (location[0]), "let".Length), QueryWhereClause.Roles.Keyword);
				
				NewAnonymousType aType = l.Expr as NewAnonymousType;
				AnonymousTypeParameter param = ((AnonymousTypeParameter)aType.Parameters[1]);
				result.AddChild (new Identifier (param.Name, Convert (param.Location)), Identifier.Roles.Identifier);
				
				if (location != null)
					result.AddChild (new CSharpTokenNode (Convert (location[1]), 1), QueryWhereClause.Roles.Assign);
				
				result.AddChild ((MonoDevelop.CSharp.Ast.Expression)param.Expr.Accept (this), QueryWhereClause.Roles.Condition);
				return result;
			}
Ejemplo n.º 10
0
 public void VisitQueryLetClause(QueryLetClause queryLetClause)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 11
0
 public JNode VisitQueryLetClause(QueryLetClause node)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 12
0
 public StringBuilder VisitQueryLetClause(QueryLetClause queryLetClause, int data)
 {
     throw new SLSharpException("SL# does not understand LINQ.");
 }
Ejemplo n.º 13
0
 public override void VisitQueryLetClause(QueryLetClause queryLetClause)
 {
     base.VisitQueryLetClause(queryLetClause);
     indexData.HasLet = true;
 }
Ejemplo n.º 14
0
 public void VisitQueryLetClause(QueryLetClause queryLetClause)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 15
0
 public void VisitQueryLetClause(QueryLetClause node)
 {
     NotSupported(node);
 }
 public virtual S VisitQueryLetClause(QueryLetClause queryLetClause, T data)
 {
     return(VisitChildren(queryLetClause, data));
 }
Ejemplo n.º 17
0
		public override void VisitQueryLetClause(QueryLetClause queryLetClause)
		{
			FixClauseIndentation(queryLetClause, queryLetClause.LetKeyword);
		}
Ejemplo n.º 18
0
		public virtual void VisitQueryLetClause(QueryLetClause queryLetClause)
		{
			DebugExpression(queryLetClause);
			StartNode(queryLetClause);
			WriteKeyword(QueryLetClause.LetKeywordRole);
			Space();
			WriteIdentifier(queryLetClause.IdentifierToken);
			Space(policy.SpaceAroundAssignment);
			WriteToken(Roles.Assign, BoxedTextColor.Operator);
			Space(policy.SpaceAroundAssignment);
			queryLetClause.Expression.AcceptVisitor(this);
			EndNode(queryLetClause);
		}
Ejemplo n.º 19
0
 public StringBuilder VisitQueryLetClause(QueryLetClause queryLetClause)
 {
     return(InvalidNode(queryLetClause, "LINQ is not supported"));
 }
Ejemplo n.º 20
0
        protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
        {
            QueryLetClause o = other as QueryLetClause;

            return(o != null && MatchString(this.Identifier, o.Identifier) && this.Expression.DoMatch(o.Expression, match));
        }
 public override void VisitQueryLetClause(QueryLetClause queryLetClause)
 {
     throw NotSupportedToConsistency();
 }
Ejemplo n.º 22
0
 public override void VisitQueryLetClause(QueryLetClause queryLetClause)
 {
     ProcessName(queryLetClause.Identifier);
     base.VisitQueryLetClause(queryLetClause);
 }
 /// <inheritdoc/>
 public virtual void VisitQueryLetClause(QueryLetClause syntax)
 {
     VisitNode(syntax);
 }
		public virtual void VisitQueryLetClause(QueryLetClause queryLetClause)
		{
			VisitChildren (queryLetClause);
		}
Ejemplo n.º 25
0
 public override void VisitQueryLetClause(QueryLetClause queryLetClause)
 {
 }
Ejemplo n.º 26
0
 public RedILNode VisitQueryLetClause(QueryLetClause queryLetClause, State data)
 {
     throw new System.NotImplementedException();
 }
 public override void VisitQueryLetClause(QueryLetClause syntax)
 {
     _underlyingVisitor.VisitQueryLetClause(syntax);
 }
Ejemplo n.º 28
0
 public Node VisitQueryLetClause(QueryLetClause queryLetClause)
 {
     return(CreateDummy(queryLetClause));
 }
 public virtual void VisitQueryLetClause(QueryLetClause queryLetClause)
 {
     if (this.ThrowException)
     {
         throw (Exception)this.CreateException(queryLetClause);
     }
 }
Ejemplo n.º 30
0
 public override void VisitQueryLetClause(QueryLetClause queryLetClause)
 {
     base.VisitQueryLetClause(queryLetClause);
     indexData.HasLet = true;
 }
Ejemplo n.º 31
0
			public override object Visit(Mono.CSharp.Linq.Let let)
			{
				var result = new QueryLetClause();
				var location = LocationsBag.GetLocations(let);
				
				result.AddChild(new CSharpTokenNode(Convert(let.Location), QueryLetClause.LetKeywordRole), QueryLetClause.LetKeywordRole);
				result.AddChild(Identifier.Create(let.IntoVariable.Name, Convert(let.IntoVariable.Location)), Roles.Identifier);
				if (location != null)
					result.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Assign), Roles.Assign);
				if (let.Expr != null)
					result.AddChild((Expression)let.Expr.Accept(this), Roles.Expression);
				return result;
			}
Ejemplo n.º 32
0
			public override void VisitQueryLetClause(QueryLetClause queryLetClause)
			{
				ProcessName(queryLetClause.Identifier);
				base.VisitQueryLetClause(queryLetClause);
			}
Ejemplo n.º 33
0
		public void VisitQueryLetClause(QueryLetClause queryLetClause)
		{
			StartNode(queryLetClause);
			WriteKeyword(QueryLetClause.LetKeywordRole);
			Space();
			queryLetClause.IdentifierToken.AcceptVisitor(this);
			Space(policy.SpaceAroundAssignment);
			WriteToken(Roles.Assign);
			Space(policy.SpaceAroundAssignment);
			queryLetClause.Expression.AcceptVisitor(this);
			EndNode(queryLetClause);
		}
Ejemplo n.º 34
0
 public virtual Node VisitQueryLetClause(QueryLetClause queryLetClause)
 {
     throw new System.NotImplementedException();
 }