Package org.rascalmpl.library.util.Eval

Examples of org.rascalmpl.library.util.Eval.EvalTimer


  }
 
 
  private Result<IValue> eval (IValue expected, IList commands, IInteger duration, IEvaluatorContext ctx) {
    IEvaluator<Result<IValue>> evaluator = ctx.getEvaluator();
    EvalTimer timer = new EvalTimer(evaluator, duration.intValue());

    Result<IValue> result = null;
   
    timer.start();

    if(!timer.hasExpired() && commands.length() > 0){
      for(IValue command : commands){
        result = evaluator.eval(null, ((IString) command).getValue(), URIUtil.rootScheme("stdin"));
      }
      timer.cancel();
      if (timer.hasExpired()) {
        throw RuntimeExceptionFactory.timeout(null, null);
      }

      if (expected != null) {
        Type typ = tr.valueToType((IConstructor) expected);
View Full Code Here

TOP

Related Classes of org.rascalmpl.library.util.Eval.EvalTimer

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.