An expression that provides runtime read/write access to variables. Needed to implement "eval" in dynamic languages. Evaluates to an instance of ILocalVariables at run time.
Inheritance: Expression
示例#1
0
 internal static RuntimeVariables RuntimeVariables(RuntimeVariablesExpression expression)
 {
     return new RuntimeVariables()
     {
         Variables = expression.Variables.Select(Parameter).ToArray(),
     }.Apply(n => n.Type = TypeRef.Serialize(expression.Type));
 }
示例#2
0
        protected override MSAst.Expression VisitRuntimeVariables(MSAst.RuntimeVariablesExpression node)
        {
            // Record all strongbox'ed variables
            foreach (MSAst.ParameterExpression local in node.Variables)
            {
                _strongBoxedLocals.Add(local, null);
            }

            return(base.VisitRuntimeVariables(node));
        }
示例#3
0
 private static string VisitRuntimeVariables(RuntimeVariablesExpression node)
 {
     throw new NotImplementedException();
 }
示例#4
0
 internal InterpreterVariables(InterpreterState state, RuntimeVariablesExpression node) {
     _state = state;
     _vars = node.Variables;
 }
 protected override Expression VisitRuntimeVariables(RuntimeVariablesExpression node)
 {
     throw new NotSupportedException();
 }
 public RuntimeVariablesExpressionProxy(RuntimeVariablesExpression node) {
     _node = node;
 }
		}//end static method
		internal XElement RuntimeVariablesExpressionToXElement(RuntimeVariablesExpression e)
		{
			object value;
			string xName = "RuntimeVariablesExpression";
			object[] XElementValues = new object[4];
			value = ((RuntimeVariablesExpression)e).Type;
			XElementValues[0] = GenerateXmlFromProperty(typeof(System.Type),
				"Type", value ?? string.Empty);
			value = ((RuntimeVariablesExpression)e).NodeType;
			XElementValues[1] = GenerateXmlFromProperty(typeof(System.Linq.Expressions.ExpressionType),
				"NodeType", value ?? string.Empty);
			value = ((RuntimeVariablesExpression)e).Variables;
			XElementValues[2] = GenerateXmlFromProperty(typeof(System.Collections.ObjectModel.ReadOnlyCollection<System.Linq.Expressions.ParameterExpression>),
				"Variables", value ?? string.Empty);
			value = ((RuntimeVariablesExpression)e).CanReduce;
			XElementValues[3] = GenerateXmlFromProperty(typeof(System.Boolean),
				"CanReduce", value ?? string.Empty);
			return new XElement(xName, XElementValues);
		}//end static method
示例#8
0
 public RuntimeVariablesExpressionProxy(RuntimeVariablesExpression node)
 {
     ContractUtils.RequiresNotNull(node, nameof(node));
     _node = node;
 }
 protected internal override Expression VisitRuntimeVariables(RuntimeVariablesExpression node)
 {
     VisitExpressions('(', node.Variables, ')');
     return(node);
 }
示例#10
0
 protected internal override Expression VisitRuntimeVariables(RuntimeVariablesExpression node)
 {
     Out(".RuntimeVariables");
     VisitExpressions('(', node.Variables.AsArrayInternal());
     return(node);
 }
示例#11
0
 private Variable VisitRuntimeVariables(RuntimeVariablesExpression node)
 {
     throw new NotSupportedException("Expression of type " + node.NodeType + " is not supported");
     //this.VisitExpressions<ParameterExpression>('(', node.Variables, ')');
 }
示例#12
0
 /// <summary>
 /// Visits the children of the <see cref="RuntimeVariablesExpression"/>.
 /// </summary>
 /// <param name="node">The expression to visit.</param>
 /// <returns>The modified expression, if it or any subexpression was modified;
 /// otherwise, returns the original expression.</returns>
 protected internal virtual Expression VisitRuntimeVariables(RuntimeVariablesExpression node)
 {
     return(node.Update(VisitAndConvert(node.Variables, nameof(VisitRuntimeVariables))));
 }
 public RuntimeVariablesExpressionProxy(RuntimeVariablesExpression node)
 {
     ContractUtils.RequiresNotNull(node, nameof(node));
     _node = node;
 }