public ExpressionTreeProxy (HoistedVariable hv)
			{
				this.hv = hv;
			}
Exemple #2
0
			public ExpressionTreeVariableReference (HoistedVariable hv)
			{
				this.hv = hv;
			}
		public ExpressionStatement CreateExpressionTreeVariable (BlockContext ec)
		{
			//
			// A parameter is not hoisted when used directly as ET
			//
			HoistedVariableReference = null;

			if ((modFlags & Modifier.ISBYREF) != 0)
				ec.Report.Error (1951, Location, "An expression tree parameter cannot use `ref' or `out' modifier");

			LocalInfo variable = ec.CurrentBlock.AddTemporaryVariable (
				ResolveParameterExpressionType (ec, Location), Location);
			variable.Resolve (ec);

			expr_tree_variable = new LocalVariableReference (
				ec.CurrentBlock, variable.Name, Location, variable, false);

			Arguments arguments = new Arguments (2);
			arguments.Add (new Argument (new TypeOf (
				new TypeExpression (parameter_type, Location), Location)));
			arguments.Add (new Argument (new StringConstant (Name, Location)));
			return new SimpleAssign (ExpressionTreeVariableReference (),
				Expression.CreateExpressionFactoryCall (ec, "Parameter", null, arguments, Location));
		}