コード例 #1
0
ファイル: linq.cs プロジェクト: furesoft/NRefactory
		public Join (QueryBlock block, RangeVariable lt, Expression inner, QueryBlock outerSelector, QueryBlock innerSelector, Location loc)
			: base (block, lt, inner, loc)
		{
			this.outer_selector = outerSelector;
			this.inner_selector = innerSelector;
		}
コード例 #2
0
ファイル: linq.cs プロジェクト: furesoft/NRefactory
		public GroupJoin (QueryBlock block, RangeVariable lt, Expression inner,
			QueryBlock outerSelector, QueryBlock innerSelector, RangeVariable into, Location loc)
			: base (block, lt, inner, outerSelector, innerSelector, loc)
		{
			this.into = into;
		}
コード例 #3
0
 protected ARangeVariableQueryClause(QueryBlock block, RangeVariable identifier, Expression expr, Location loc)
     : base(block, expr, loc)
 {
     this.identifier = identifier;
 }
コード例 #4
0
ファイル: linq.cs プロジェクト: furesoft/NRefactory
		public QueryStartClause (QueryBlock block, Expression expr, RangeVariable identifier, Location loc)
			: base (block, identifier, expr, loc)
		{
			block.AddRangeVariable (identifier);
		}
コード例 #5
0
ファイル: cs-parser.cs プロジェクト: furesoft/NRefactory
void case_1033()
#line 6960 "cs-parser.jay"
{
		var lt = (LocatedToken) yyVals[-3+yyTop];
		var sn = new Linq.RangeVariable (lt.Value, lt.Location);

		yyVal = new Linq.SelectMany ((Linq.QueryBlock)current_block, sn, (Expression)yyVals[0+yyTop], GetLocation (yyVals[-5+yyTop])) {
			IdentifierType = (FullNamedExpression)yyVals[-4+yyTop]
		};
		
		current_block.SetEndLocation (lexer.Location);
		current_block = current_block.Parent;
		
		((Linq.QueryBlock)current_block).AddRangeVariable (sn);
		
		lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]));
	  }
コード例 #6
0
ファイル: cs-parser.cs プロジェクト: furesoft/NRefactory
void case_1060()
#line 7145 "cs-parser.jay"
{
		current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop]));
		current_block.SetEndLocation (lexer.Location);
	  
		var outer_selector = linq_clause_blocks.Pop ();
		var block = linq_clause_blocks.Pop ();

		var lt = (LocatedToken) yyVals[-10+yyTop];	
		var sn = new Linq.RangeVariable (lt.Value, lt.Location);
		Linq.RangeVariable into;
		
		if (yyVals[0+yyTop] == null) {
			into = sn;
	  		yyVal = new Linq.Join (block, sn, (Expression)yyVals[-7+yyTop], outer_selector, (Linq.QueryBlock) current_block, GetLocation (yyVals[-11+yyTop]));
			lbag.AddLocation (yyVal, GetLocation (yyVals[-9+yyTop]), GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-3+yyTop]));
		} else {
			/**/
			/* Set equals right side parent to beginning of linq query, it is not accessible therefore cannot cause name collisions*/
			/**/
			var parent = block.Parent;
			while (parent is Linq.QueryBlock) {
				parent = parent.Parent;
			}
			current_block.Parent = parent;
			
			((Linq.QueryBlock)current_block).AddRangeVariable (sn);
		
			lt = (LocatedToken) yyVals[0+yyTop];
			into = new Linq.RangeVariable (lt.Value, lt.Location);

			yyVal = new Linq.GroupJoin (block, sn, (Expression)yyVals[-7+yyTop], outer_selector, (Linq.QueryBlock) current_block, into, GetLocation (yyVals[-11+yyTop]));	
			lbag.AddLocation (yyVal, GetLocation (yyVals[-9+yyTop]), GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-3+yyTop]), opt_intoStack.Pop ());
		}

		current_block = block.Parent;
		((Linq.QueryBlock)current_block).AddRangeVariable (into);
	  }

void case_1061()
#line 7183 "cs-parser.jay"
{
		if (linq_clause_blocks == null)
			linq_clause_blocks = new Stack<Linq.QueryBlock> ();
	  		
		current_block = new Linq.QueryBlock (current_block, lexer.Location);
		linq_clause_blocks.Push ((Linq.QueryBlock) current_block);
	  }

void case_1062()
#line 7191 "cs-parser.jay"
{
		current_block.SetEndLocation (lexer.Location);
		current_block = current_block.Parent;

		current_block = new Linq.QueryBlock (current_block, lexer.Location);
		linq_clause_blocks.Push ((Linq.QueryBlock) current_block);
	  }

void case_1063()
#line 7199 "cs-parser.jay"
{
		current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop]));
		current_block.SetEndLocation (lexer.Location);
		current_block = current_block.Parent;

		current_block = new Linq.QueryBlock (current_block, lexer.Location);
	  }

void case_1064()
#line 7207 "cs-parser.jay"
{
		current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop]));
		current_block.SetEndLocation (lexer.Location);
	  
		var outer_selector = linq_clause_blocks.Pop ();
		var block = linq_clause_blocks.Pop ();
		
		var lt = (LocatedToken) yyVals[-10+yyTop];
		var sn = new Linq.RangeVariable (lt.Value, lt.Location);
		Linq.RangeVariable into;
		
		if (yyVals[0+yyTop] == null) {
			into = sn;		
	  		yyVal = new Linq.Join (block, sn, (Expression)yyVals[-7+yyTop], outer_selector, (Linq.QueryBlock) current_block, GetLocation (yyVals[-12+yyTop])) {
	  			IdentifierType = (FullNamedExpression)yyVals[-11+yyTop]
	  		};
			lbag.AddLocation (yyVal, GetLocation (yyVals[-10+yyTop]), GetLocation (yyVals[-7+yyTop]), GetLocation (yyVals[-4+yyTop]));
		} else {
			/**/
			/* Set equals right side parent to beginning of linq query, it is not accessible therefore cannot cause name collisions*/
			/**/
			var parent = block.Parent;
			while (parent is Linq.QueryBlock) {
				parent = parent.Parent;
			}
			current_block.Parent = parent;
		
			((Linq.QueryBlock)current_block).AddRangeVariable (sn);
		
			lt = (LocatedToken) yyVals[0+yyTop];
			into = new Linq.RangeVariable (lt.Value, lt.Location); /* TODO:*/
			
			yyVal = new Linq.GroupJoin (block, sn, (Expression)yyVals[-7+yyTop], outer_selector, (Linq.QueryBlock) current_block, into, GetLocation (yyVals[-12+yyTop])) {
	  			IdentifierType = (FullNamedExpression)yyVals[-11+yyTop]
	  		};			
			lbag.AddLocation (yyVal, GetLocation (yyVals[-10+yyTop]), GetLocation (yyVals[-7+yyTop]), GetLocation (yyVals[-4+yyTop]), opt_intoStack.Pop ());
		}
		
		current_block = block.Parent;
		((Linq.QueryBlock)current_block).AddRangeVariable (into);		
	  }
コード例 #7
0
 public TransparentParameter(Parameter parent, RangeVariable identifier)
     : base(ParameterNamePrefix + Counter++, identifier.Location)
 {
     Parent     = parent;
     Identifier = identifier.Name;
 }
コード例 #8
0
ファイル: linq.cs プロジェクト: furesoft/NRefactory
		public void AddRangeVariable (RangeVariable variable)
		{
			variable.Block = this;
			TopBlock.AddLocalName (variable.Name, variable, true);
		}
コード例 #9
0
 public GroupJoin(QueryBlock block, RangeVariable lt, Expression inner,
                  QueryBlock outerSelector, QueryBlock innerSelector, RangeVariable into, Location loc)
     : base(block, lt, inner, outerSelector, innerSelector, loc)
 {
     this.into = into;
 }
コード例 #10
0
 public SelectMany(QueryBlock block, RangeVariable identifier, Expression expr, Location loc)
     : base(block, identifier, expr, loc)
 {
 }
コード例 #11
0
 public Join(QueryBlock block, RangeVariable lt, Expression inner, QueryBlock outerSelector, QueryBlock innerSelector, Location loc)
     : base(block, lt, inner, loc)
 {
     this.outer_selector = outerSelector;
     this.inner_selector = innerSelector;
 }
コード例 #12
0
 public QueryStartClause(QueryBlock block, Expression expr, RangeVariable identifier, Location loc)
     : base(block, identifier, expr, loc)
 {
     block.AddRangeVariable(identifier);
 }
コード例 #13
0
        protected static Expression CreateRangeVariableType(ResolveContext rc, Parameter parameter, RangeVariable name, Expression init)
        {
            var args = new List <AnonymousTypeParameter> (2);

            //
            // The first argument is the reference to the parameter
            //
            args.Add(new AnonymousTypeParameter(new RangeParameterReference(parameter), parameter.Name, parameter.Location));

            //
            // The second argument is the linq expression
            //
            args.Add(new RangeAnonymousTypeParameter(init, name));

            //
            // Create unique anonymous type
            //
            return(new NewAnonymousType(args, rc.MemberContext.CurrentMemberDefinition.Parent, name.Location));
        }
コード例 #14
0
ファイル: linq.cs プロジェクト: furesoft/NRefactory
		public SelectMany (QueryBlock block, RangeVariable identifier, Expression expr, Location loc)
			: base (block, identifier, expr, loc)
		{
		}
コード例 #15
0
 public void AddRangeVariable(RangeVariable variable)
 {
     variable.Block = this;
     TopBlock.AddLocalName(variable.Name, variable, true);
 }
コード例 #16
0
ファイル: linq.cs プロジェクト: furesoft/NRefactory
			public TransparentParameter (Parameter parent, RangeVariable identifier)
				: base (ParameterNamePrefix + Counter++, identifier.Location)
			{
				Parent = parent;
				Identifier = identifier.Name;
			}
コード例 #17
0
ファイル: linq.cs プロジェクト: furesoft/NRefactory
			public RangeAnonymousTypeParameter (Expression initializer, RangeVariable parameter)
				: base (initializer, parameter.Name, parameter.Location)
			{
			}
コード例 #18
0
ファイル: cs-parser.cs プロジェクト: furesoft/NRefactory
void case_1029()
#line 6926 "cs-parser.jay"
{
		current_block = new Linq.QueryBlock (current_block, lexer.Location);
	  
		var lt = (LocatedToken) yyVals[-2+yyTop];
		var rv = new Linq.RangeVariable (lt.Value, lt.Location);
		var clause = new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], rv, GetLocation (yyVals[-4+yyTop])) {
				IdentifierType = (FullNamedExpression)yyVals[-3+yyTop]
		};
		lbag.AddLocation (clause, GetLocation (yyVals[-1+yyTop]));
		yyVal = new Linq.QueryExpression (clause);
	  }
コード例 #19
0
ファイル: linq.cs プロジェクト: furesoft/NRefactory
		protected ARangeVariableQueryClause (QueryBlock block, RangeVariable identifier, Expression expr, Location loc)
			: base (block, expr, loc)
		{
			this.identifier = identifier;
		}
コード例 #20
0
ファイル: cs-parser.cs プロジェクト: furesoft/NRefactory
void case_1054()
#line 7092 "cs-parser.jay"
{
		var lt = (LocatedToken) yyVals[-3+yyTop];
		var sn = new Linq.RangeVariable (lt.Value, lt.Location);
	  	yyVal = new Linq.Let ((Linq.QueryBlock) current_block, sn, (Expression)yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop]));
		lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]));
	  	
		current_block.SetEndLocation (lexer.Location);
		current_block = current_block.Parent;
		
		((Linq.QueryBlock)current_block).AddRangeVariable (sn);
	  }
コード例 #21
0
ファイル: linq.cs プロジェクト: furesoft/NRefactory
		protected static Expression CreateRangeVariableType (ResolveContext rc, Parameter parameter, RangeVariable name, Expression init)
		{
			var args = new List<AnonymousTypeParameter> (2);

			//
			// The first argument is the reference to the parameter
			//
			args.Add (new AnonymousTypeParameter (new RangeParameterReference (parameter), parameter.Name, parameter.Location));

			//
			// The second argument is the linq expression
			//
			args.Add (new RangeAnonymousTypeParameter (init, name));

			//
			// Create unique anonymous type
			//
			return new NewAnonymousType (args, rc.MemberContext.CurrentMemberDefinition.Parent, name.Location);
		}
コード例 #22
0
ファイル: cs-parser.cs プロジェクト: furesoft/NRefactory
void case_1083()
#line 7360 "cs-parser.jay"
{
		var current_block = linq_clause_blocks.Pop ();	  
		var lt = (LocatedToken) yyVals[-2+yyTop];
		var rv = new Linq.RangeVariable (lt.Value, lt.Location);
  		yyVal = new Linq.QueryStartClause ((Linq.QueryBlock)current_block, null, rv, GetLocation (yyVals[-3+yyTop])) {
  			next = (Linq.AQueryClause)yyVals[0+yyTop]
  		};
	  }
コード例 #23
0
 public RangeAnonymousTypeParameter(Expression initializer, RangeVariable parameter)
     : base(initializer, parameter.Name, parameter.Location)
 {
 }