Beispiel #1
0
 public Join(ToplevelBlock block, LocatedToken lt, Expression inner, ToplevelBlock outerSelector, ToplevelBlock innerSelector, Location loc)
     : base(block, inner)
 {
     this.lt             = lt;
     this.outer_selector = outerSelector;
     this.inner_selector = innerSelector;
 }
Beispiel #2
0
 public QueryBlock(CompilerContext ctx, Block parent, LocatedToken lt, Location start)
     : base(ctx, parent, new ParametersCompiled(new ImplicitQueryParameter(lt.Value, lt.Location)), start)
 {
     if (parent != null)
     {
         base.CheckParentConflictName(parent.Toplevel, lt.Value, lt.Location);
     }
 }
Beispiel #3
0
        protected override void CreateArguments(ResolveContext ec, out Arguments args)
        {
            args = new Arguments(4);

            args.Add(new Argument(expr));

            LambdaExpression lambda = new LambdaExpression(outer_selector.StartLocation);

            lambda.Block = outer_selector;
            args.Add(new Argument(lambda));

            lambda       = new LambdaExpression(inner_selector.StartLocation);
            lambda.Block = inner_selector;
            args.Add(new Argument(lambda));

            Expression   result_selector_expr;
            LocatedToken into_variable = GetIntoVariable();

            //
            // When select follows use is as result selector
            //
            if (next is Select)
            {
                result_selector_expr = next.expr;
                next = next.next;
            }
            else
            {
                result_selector_expr = CreateRangeVariableType(block, ec.MemberContext, into_variable,
                                                               new SimpleName(into_variable.Value, into_variable.Location));
            }

            LambdaExpression result_selector = new LambdaExpression(lt.Location);

            result_selector.Block = new QueryBlock(ec.Compiler, block.Parent, block.Parameters, into_variable, block.StartLocation);
            result_selector.Block.AddStatement(new ContextualReturn(result_selector_expr));

            args.Add(new Argument(result_selector));
        }
Beispiel #4
0
 public RangeAnonymousTypeParameter(Expression initializer, LocatedToken parameter)
     : base(initializer, parameter.Value, parameter.Location)
 {
 }
Beispiel #5
0
	public VariableDeclaration (LocatedToken lt, object eoai) : this (lt, eoai, null)
	{
	}
Beispiel #6
0
	public VariableDeclaration (LocatedToken lt, object eoai, Attributes opt_attrs)
	{
		this.identifier = lt.Value;
		if (eoai is ArrayList) {
			this.expression_or_array_initializer = new ArrayCreation (CSharpParser.current_array_type, "", (ArrayList)eoai, lt.Location);
		} else {
			this.expression_or_array_initializer = (Expression)eoai;
		}
		this.Location = lt.Location;
		this.OptAttributes = opt_attrs;
	}
Beispiel #7
0
		public QueryBlock (CompilerContext ctx, Block parent, ParametersCompiled parameters, LocatedToken lt, Location start)
			: base (ctx, parent, new ParametersCompiled (parameters [0].Clone (), new ImplicitQueryParameter (lt.Value, lt.Location)), start)
		{
		}
Beispiel #8
0
 public QueryBlock(CompilerContext ctx, Block parent, ParametersCompiled parameters, LocatedToken lt, Location start)
     : base(ctx, parent, new ParametersCompiled(parameters [0].Clone(), new ImplicitQueryParameter(lt.Value, lt.Location)), start)
 {
 }
Beispiel #9
0
 public TransparentParameter(ParametersCompiled parent, LocatedToken identifier)
     : base(ParameterNamePrefix + Counter++, identifier.Location)
 {
     Parent     = parent;
     Identifier = identifier.Value;
 }
Beispiel #10
0
		protected static Expression CreateRangeVariableType (ToplevelBlock block, TypeContainer container, LocatedToken name, Expression init)
		{
			ArrayList args = new ArrayList (2);
			args.Add (new AnonymousTypeParameter (block.Parameters [0]));
			args.Add (new RangeAnonymousTypeParameter (init, name));
			return new AnonymousTypeDeclaration (args, container, name.Location);
		}
Beispiel #11
0
		public SelectMany (ToplevelBlock block, LocatedToken lt, Expression expr)
			: base (block, expr)
		{
			this.lt = lt;
		}
Beispiel #12
0
			public TransparentParameter (Parameters parent, LocatedToken identifier)
				: base (ParameterNamePrefix + Counter++, identifier.Location)
			{
				Parent = parent;
				Identifier = identifier.Value;
			}
Beispiel #13
0
		public Let (ToplevelBlock block, TypeContainer container, LocatedToken identifier, Expression expr)
			: base (block, CreateRangeVariableType (block, container, identifier, expr))
		{
		}
Beispiel #14
0
		public GroupJoin (ToplevelBlock block, LocatedToken lt, Expression inner,
			ToplevelBlock outerSelector, ToplevelBlock innerSelector, LocatedToken into, Location loc)
			: base (block, lt, inner, outerSelector, innerSelector, loc)
		{
			this.into = into;
		}
Beispiel #15
0
		public Join (ToplevelBlock block, LocatedToken lt, Expression inner, ToplevelBlock outerSelector, ToplevelBlock innerSelector, Location loc)
			: base (block, inner)
		{
			this.lt = lt;
			this.outer_selector = outerSelector;
			this.inner_selector = innerSelector;
		}
Beispiel #16
0
        protected static Expression CreateRangeVariableType(ToplevelBlock block, IMemberContext context, LocatedToken name, Expression init)
        {
            ArrayList args = new ArrayList(2);

            args.Add(new AnonymousTypeParameter(block.Parameters [0]));
            args.Add(new RangeAnonymousTypeParameter(init, name));
            return(new NewAnonymousType(args, context.CurrentTypeDefinition, name.Location));
        }
Beispiel #17
0
 public Let(ToplevelBlock block, TypeContainer container, LocatedToken identifier, Expression expr)
     : base(block, CreateRangeVariableType(block, container, identifier, expr))
 {
 }
Beispiel #18
0
		public QueryBlock (Block parent, LocatedToken lt, Location start)
			: base (parent, new Parameters (new ImplicitQueryParameter (lt.Value, lt.Location)), start)
		{
			if (parent != null)
				base.CheckParentConflictName (parent.Toplevel, lt.Value, lt.Location);
		}
Beispiel #19
0
			public RangeAnonymousTypeParameter (Expression initializer, LocatedToken parameter)
				: base (initializer, parameter.Value, parameter.Location)
			{
			}
Beispiel #20
0
 public GroupJoin(ToplevelBlock block, LocatedToken lt, Expression inner,
                  ToplevelBlock outerSelector, ToplevelBlock innerSelector, LocatedToken into, Location loc)
     : base(block, lt, inner, outerSelector, innerSelector, loc)
 {
     this.into = into;
 }
Beispiel #21
0
		public QueryBlock (Block parent, Parameters parameters, LocatedToken lt, Location start)
			: base (parent, new Parameters (parameters [0].Clone (), new ImplicitQueryParameter (lt.Value, lt.Location)), start)
		{
		}
Beispiel #22
0
 public SelectMany(ToplevelBlock block, LocatedToken lt, Expression expr)
     : base(block, expr)
 {
     this.lt = lt;
 }
Beispiel #23
0
		public void AddTransparentParameter (LocatedToken name)
		{
			base.CheckParentConflictName (this, name.Value, name.Location);

			parameters = new Parameters (new TransparentParameter (parameters, name));
		}
Beispiel #24
0
        protected static Expression CreateRangeVariableType(ToplevelBlock block, TypeContainer container, LocatedToken name, Expression init)
        {
            ArrayList args = new ArrayList(2);

            args.Add(new AnonymousTypeParameter(block.Parameters [0]));
            args.Add(new RangeAnonymousTypeParameter(init, name));
            return(new AnonymousTypeDeclaration(args, container, name.Location));
        }
Beispiel #25
0
 public QueryBlock(Block parent, Parameters parameters, LocatedToken lt, Location start)
     : base(parent, new Parameters(parameters [0].Clone(), new ImplicitQueryParameter(lt.Value, lt.Location)), start)
 {
 }
Beispiel #26
0
        public void AddTransparentParameter(LocatedToken name)
        {
            base.CheckParentConflictName(this, name.Value, name.Location);

            parameters = new ParametersCompiled(new TransparentParameter(parameters, name));
        }
Beispiel #27
0
		protected static Expression CreateRangeVariableType (ToplevelBlock block, IMemberContext context, LocatedToken name, Expression init)
		{
			ArrayList args = new ArrayList (2);
			args.Add (new AnonymousTypeParameter (block.Parameters [0]));
			args.Add (new RangeAnonymousTypeParameter (init, name));
			return new NewAnonymousType (args, context.CurrentTypeDefinition, name.Location);
		}