Esempio n. 1
0
        public override AbstractValue AbstractEvaluate(AbstractContext context) {
            List<AbstractValue> values = new List<AbstractValue>();
            foreach (Expression arg in _arguments) {
                values.Add(arg.AbstractEvaluate(context));
            }

            return context.Binder.AbstractExecute(_action, values);
        }
Esempio n. 2
0
        public override AbstractValue AbstractEvaluate(AbstractContext context)
        {
            List <AbstractValue> values = new List <AbstractValue>();

            foreach (Expression arg in _arguments)
            {
                values.Add(arg.AbstractEvaluate(context));
            }

            return(context.Binder.AbstractExecute(_action, values));
        }
 public override AbstractValue AbstractEvaluate(AbstractContext context)
 {
     return(AbstractValue.Constant(_value, this));
 }
Esempio n. 4
0
 public override AbstractValue AbstractEvaluate(AbstractContext context)
 {
     return(context.Lookup(_variable));
 }
Esempio n. 5
0
 public override AbstractValue AbstractEvaluate(AbstractContext context) {
     return context.Lookup(_variable);
 } 
Esempio n. 6
0
        public AbstractValue AbstractCall(AbstractContext context, IList<AbstractValue> args) {
            AbstractValue[] callArgs = new AbstractValue[_argBuilders.Count];
            for (int i = 0; i < _argBuilders.Count; i++) {
                callArgs[i] = _argBuilders[i].AbstractBuild(context, args);
            }

            Expression[] argExprs = new Expression[callArgs.Length];
            for (int i = 0; i < callArgs.Length; i++) {
                Expression expr = callArgs[i].Expression;
                if (expr == null) {
                    argExprs = null;
                    break;
                } else {
                    argExprs[i] = expr;
                }
            }

            Expression callExpr = null;
            if (argExprs != null) {
                MethodInfo mi = Method as MethodInfo;
                if (mi != null) {
                    Expression instance = mi.IsStatic ? null : _instanceBuilder.AbstractBuild(context, args).Expression;
                    callExpr = Ast.SimpleCallHelper(instance, mi, argExprs);
                } else {
                    callExpr = Ast.SimpleNewHelper((ConstructorInfo)Method, argExprs);
                }
            }

            return AbstractValue.LimitType(this.ReturnType, callExpr);
        } 
Esempio n. 7
0
 public virtual AbstractValue AbstractEvaluate(AbstractContext context)
 {
     throw new NotImplementedException();
 }
Esempio n. 8
0
 public override AbstractValue AbstractBuild(AbstractContext context, IList<AbstractValue> parameters) {
     AbstractValue value = parameters[_index];
     return context.Binder.AbstractExecute(ConvertToAction.Make(_parameterType), new AbstractValue[] { value });
 } 
Esempio n. 9
0
 public virtual AbstractValue AbstractBuild(AbstractContext context, IList<AbstractValue> parameters) {
     throw new NotImplementedException();
 }