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
ファイル: RuntimeVariables.cs プロジェクト: takeshik/yacq
 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;
 }
コード例 #5
0
 protected override Expression VisitRuntimeVariables(RuntimeVariablesExpression node)
 {
     throw new NotSupportedException();
 }
コード例 #6
0
 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;
 }
コード例 #9
0
 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
ファイル: BasicBlockBuilder.cs プロジェクト: xornand/rDSN
 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))));
 }
コード例 #13
0
 public RuntimeVariablesExpressionProxy(RuntimeVariablesExpression node)
 {
     ContractUtils.RequiresNotNull(node, nameof(node));
     _node = node;
 }