Exemplo n.º 1
0
        private IValue interpretOperator(Context context, IValue value, Operator oper)
        {
            IMethodDeclaration decl = declaration.findOperator(context, oper, value.GetIType());

            context = context.newInstanceContext(this, false).newChildContext();
            decl.registerParameters(context);
            IParameter arg = decl.getParameters()[0];

            context.setValue(arg.GetName(), value);
            return(decl.interpret(context));
        }
Exemplo n.º 2
0
        public override IValue interpret(Context context)
        {
            MethodFinder       finder      = new MethodFinder(context, this);
            IMethodDeclaration declaration = finder.findBest(true);

            if (declaration == null)
            {
                throw new SyntaxError("No such method: " + this.ToString());
            }
            Context local = selector.newLocalContext(context, declaration);

            declaration.registerParameters(local);
            assignArguments(context, local, declaration);
            return(declaration.interpret(local));
        }
Exemplo n.º 3
0
 public IValue interpret(Context context)
 {
     return(wrapped.interpret(context));
 }