Package org.rascalmpl.interpreter.result

Examples of org.rascalmpl.interpreter.result.ICallableValue.call()


   
    if (var != null && var instanceof ICallableValue) {
      Type type = RascalTypeFactory.getInstance().nonTerminalType(ambCluster);
      ICallableValue func = (ICallableValue) var;
      try {
        Result<IValue> result = func.call(
            new Type[] {TF.setType(type)}, new IValue[] {alts}, null
        );
       
        if (result.getType().isBottom()) {
          return ambCluster;
View Full Code Here


    checkUnaryFunction("second", to);
    checkUnaryFunction("third", from);
    ICursor c = (ICursor)cursor;
    Context ctx = new InvertorContext(c.getCtx(), (ICallableValue)from);
    ICallableValue f = (ICallableValue)to;
    IValue computed = f.call(new Type[] {c.getWrappedValue().getType()}, new IValue[] { c.getWrappedValue() }, null).getValue();
    return CursorFactory.makeCursor(computed, ctx);
  }

 
View Full Code Here

        Type[] argTypes = new org.eclipse.imp.pdb.facts.type.Type[] {TF.stringType(), TF.sourceLocationType()};
        IValue[] argValues = new IValue[] { mn, sl };
       
        // Invoke the importer, which should generate the text of the module that we need
        // to actually import.
        IValue module = importer.call(argTypes, argValues, null).getValue();
        String moduleText = module.getType().isString() ? ((IString) module).getValue() : TreeAdapter.yield((IConstructor) module);
       
        moduleText = "@generated\n" + moduleText;
       
        try {
View Full Code Here

      return null;
    }
    TypeFactory tf = TypeFactory.getInstance();

    ICallableValue generator = generators.get(type);
    Result<IValue> result = generator.call(new Type[] { tf.integerType() },
        new IValue[] { vf.integer(depthLimit) }, null);
    return result.getValue();
  }

  private RandomValueTypeVisitor descend() {
View Full Code Here

        IMap filesVal= makeMap(files);
        ISourceLocation loc = vf.sourceLocation(URIUtil.assumeCorrect("request", "", uri));
        try {
          synchronized (callee.getEval()) {
            callee.getEval().__setInterrupt(false);
            Result<IValue> response = callee.call(argTypes, new IValue[] { loc, methodVal, headersVal, paramsVal, filesVal }, null);
            return translateResponse(method, response.getValue())
          }
        }
        catch (Throw rascalException) {
          ctx.getStdErr().println(rascalException.getMessage());
View Full Code Here

    }
   
    Type[] argTypes = new Type[] { TypeFactory.getInstance().sourceLocationType() };
    IValue[] argValues = new IValue[] { loc };
   
    return (ISourceLocation) resolver.call(argTypes, argValues, null).getValue();
  }
 
  /**
   * Allocate a new module on the heap
   * @param name
View Full Code Here

    }
   
    Type[] argTypes = new Type[] { TypeFactory.getInstance().sourceLocationType() };
    IValue[] argValues = new IValue[] { loc };
   
    return (ISourceLocation) resolver.call(argTypes, argValues, null).getValue();
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.