Exemple #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;
 }
Exemple #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);
     }
 }
Exemple #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));
        }
Exemple #4
0
 public RangeAnonymousTypeParameter(Expression initializer, LocatedToken parameter)
     : base(initializer, parameter.Value, parameter.Location)
 {
 }
Exemple #5
0
	public VariableDeclaration (LocatedToken lt, object eoai) : this (lt, eoai, null)
	{
	}
Exemple #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;
	}
		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)
		{
		}
Exemple #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)
 {
 }
Exemple #9
0
 public TransparentParameter(ParametersCompiled parent, LocatedToken identifier)
     : base(ParameterNamePrefix + Counter++, identifier.Location)
 {
     Parent     = parent;
     Identifier = identifier.Value;
 }
Exemple #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);
		}
Exemple #11
0
		public SelectMany (ToplevelBlock block, LocatedToken lt, Expression expr)
			: base (block, expr)
		{
			this.lt = lt;
		}
Exemple #12
0
			public TransparentParameter (Parameters parent, LocatedToken identifier)
				: base (ParameterNamePrefix + Counter++, identifier.Location)
			{
				Parent = parent;
				Identifier = identifier.Value;
			}
Exemple #13
0
		public Let (ToplevelBlock block, TypeContainer container, LocatedToken identifier, Expression expr)
			: base (block, CreateRangeVariableType (block, container, identifier, expr))
		{
		}
Exemple #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;
		}
Exemple #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;
		}
Exemple #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));
        }
Exemple #17
0
 public Let(ToplevelBlock block, TypeContainer container, LocatedToken identifier, Expression expr)
     : base(block, CreateRangeVariableType(block, container, identifier, expr))
 {
 }
Exemple #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);
		}
Exemple #19
0
			public RangeAnonymousTypeParameter (Expression initializer, LocatedToken parameter)
				: base (initializer, parameter.Value, parameter.Location)
			{
			}
Exemple #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;
 }
Exemple #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)
		{
		}
Exemple #22
0
 public SelectMany(ToplevelBlock block, LocatedToken lt, Expression expr)
     : base(block, expr)
 {
     this.lt = lt;
 }
Exemple #23
0
		public void AddTransparentParameter (LocatedToken name)
		{
			base.CheckParentConflictName (this, name.Value, name.Location);

			parameters = new Parameters (new TransparentParameter (parameters, name));
		}
Exemple #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));
        }
Exemple #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)
 {
 }
Exemple #26
0
        public void AddTransparentParameter(LocatedToken name)
        {
            base.CheckParentConflictName(this, name.Value, name.Location);

            parameters = new ParametersCompiled(new TransparentParameter(parameters, name));
        }
		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);
		}