Package wyvern.tools.typedAST.core.expressions

Examples of wyvern.tools.typedAST.core.expressions.Application


  }

  @Override
  public TypedAST parse(ParseBuffer input) throws IOException, CopperParserException {
    TypedAST quoted = (TypedAST) new WyvernQuote().parse(input.getSrcString()+"\n");
    return new Application(new ExternalFunction(arrow(unit, Util.javaToWyvType(TypedAST.class)), (env, arg) -> {
      TypedAST adapted = new ToastExecutor(env).transform(quoted);
      return Util.toWyvObj(adapted);
    }), UnitVal.getInstance(FileLocation.UNKNOWN), FileLocation.UNKNOWN);
  }
View Full Code Here


  }

  public static Object doInvoke(Obj receiver, String target, Object[] args) {
    Value arguments = toWyvObjs(args);
    return toJavaObject((
        new Application(
            new Invocation(receiver, target, null, FileLocation.UNKNOWN),
            arguments, FileLocation.UNKNOWN)
            .evaluate(Environment.getEmptyEnvironment())), null);//Therefore, can only handle strings and ints
  }
View Full Code Here

 

  public static Object doInvokeVarargs(Obj receiver, String target, Object... args) {
    Value arguments = toWyvObjs(args);
    return toJavaObject((
        new Application(
            new Invocation(receiver, target, null, FileLocation.UNKNOWN),
            arguments, FileLocation.UNKNOWN)
            .evaluate(Environment.getEmptyEnvironment())), null);//Therefore, can only handle strings and ints
  }
View Full Code Here

            arguments, FileLocation.UNKNOWN)
            .evaluate(Environment.getEmptyEnvironment())), null);//Therefore, can only handle strings and ints
  }

  public static Value invokeValue(Value reciever, String target, Value args) {
    return new Application(
        new Invocation(reciever,target, null, FileLocation.UNKNOWN),
        args, FileLocation.UNKNOWN).evaluate(Environment.getEmptyEnvironment());
  }
View Full Code Here

    else if (args.length == 1)
      iargs = args[0];
    else
      iargs = new TupleValue(null, args);

    return new Application(
        new Invocation(reciever,target, null, FileLocation.UNKNOWN),
        iargs, FileLocation.UNKNOWN).evaluate(Environment.getEmptyEnvironment());
  }
View Full Code Here

TOP

Related Classes of wyvern.tools.typedAST.core.expressions.Application

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.