Examples of InterruptException


Examples of org.rascalmpl.interpreter.control_exceptions.InterruptException

    IListWriter w = vf.listWriter();
    if (iFrom.lessEqual(iTo).getValue() && diff.greater(zero).getValue()) {
      do {
        w.append(iFrom);
        iFrom = iFrom.add(diff);
        if (ctx.isInterrupted()) throw new InterruptException(ctx.getStackTrace(), ctx.getCurrentAST().getLocation());
      } while (iFrom.lessEqual(iTo).getValue());
    }
    else if (iFrom.greaterEqual(iTo).getValue() && diff.less(zero).getValue()) {
      do {
        w.append(iFrom);
View Full Code Here

Examples of org.rascalmpl.interpreter.control_exceptions.InterruptException

        gens[0] = generators.get(0).getBacktracker(__eval);
        gens[0].init();

        while (i >= 0 && i < size) {
          if (__eval.isInterrupted())
            throw new InterruptException(__eval.getStackTrace(), __eval.getCurrentAST().getLocation());
          if (gens[i].hasNext() && gens[i].next()) {
            if (i == size - 1) {
              __eval.getCurrentEnvt().storeVariable(IT, it);
              it = result.interpret(__eval);
              __eval.unwind(olds[i]);
View Full Code Here

Examples of org.rascalmpl.interpreter.control_exceptions.InterruptException

      gens[0] = generators.get(0).getBacktracker(eval);
      gens[0].init();

      while (i >= 0 && i < size) {
        if (eval.isInterrupted())
          throw new InterruptException(eval.getStackTrace(), eval.getCurrentAST().getLocation());
        if (gens[i].hasNext() && gens[i].next()) {
          if (i == size - 1) {
            w.append();
          } else {
            i++;
View Full Code Here

Examples of org.rascalmpl.interpreter.control_exceptions.InterruptException

 
      while (mp.hasNext()) {
        eval.pushEnv();
       
        if (eval.isInterrupted()) {
          throw new InterruptException(eval.getStackTrace(), eval.getCurrentAST().getLocation());
        }
 
        if (mp.next()) {
          try {
            try {
View Full Code Here

Examples of org.rascalmpl.interpreter.control_exceptions.InterruptException

        IMatchingResult mp = pat.getMatcher(eval);
        mp.initMatch(subject);

        while (mp.hasNext()) {
          if (eval.isInterrupted())
            throw new InterruptException(eval.getStackTrace(), eval.getCurrentAST().getLocation());
          if (mp.next()) {
            int size = conditions.size();
           
            if (size == 0) {
               throw new Insert(replacementExpr.interpret(eval), mp, mp.getType(eval.getCurrentEnvt(), null));
            }
           
            IBooleanResult[] gens = new IBooleanResult[size];
            Environment[] olds = new Environment[size];
            Environment old2 = eval.getCurrentEnvt();

            int i = 0;
            try {
              olds[0] = eval.getCurrentEnvt();
              eval.pushEnv();
              gens[0] = conditions.get(0).getBacktracker(eval);
              gens[0].init();

              while (i >= 0 && i < size) {

                if (eval.isInterrupted()) {
                  throw new InterruptException(eval.getStackTrace(), eval.getCurrentAST().getLocation());
                }
                if (gens[i].hasNext() && gens[i].next()) {
                  if (i == size - 1) {
                    // in IfThen the body is executed, here we insert the expression
                    // NB: replaceMentExpr sees the latest bindings of the when clause
View Full Code Here

Examples of org.rascalmpl.interpreter.control_exceptions.InterruptException

            }
 
            gen = generator.getBacktracker(__eval);
            gen.init();
            if (__eval.isInterrupted()) {
              throw new InterruptException(__eval.getStackTrace(), __eval.getCurrentAST().getLocation());
            }
            if (!(gen.hasNext() && gen.next())) {
              value = __eval.__getAccumulators().pop().done();
              return org.rascalmpl.interpreter.result.ResultFactory
                  .makeResult(value.getType(), value, __eval);
View Full Code Here

Examples of org.rascalmpl.interpreter.control_exceptions.InterruptException

        gens[0] = generators.get(0).getBacktracker(__eval);
        gens[0].init();

        while (i >= 0 && i < size) {
          if (__eval.isInterrupted()) {
            throw new InterruptException(__eval.getStackTrace(), __eval.getCurrentAST().getLocation());
          }
          if (gens[i].hasNext() && gens[i].next()) {
            if (i == size - 1) {
              // NB: no result handling here.
              __eval.setCurrentAST(body);
View Full Code Here

Examples of org.rascalmpl.interpreter.control_exceptions.InterruptException

        gens[0].init();

        while (i >= 0 && i < size) {

          if (__eval.isInterrupted()) {
            throw new InterruptException(__eval.getStackTrace(), __eval.getCurrentAST().getLocation());
          }
          if (gens[i].hasNext() && gens[i].next()) {
            if (i == size - 1) {
              __eval.setCurrentAST(body);
              try {
View Full Code Here

Examples of org.rascalmpl.interpreter.control_exceptions.InterruptException

        gens[0].init();

        while (i >= 0 && i < size) {

          if (__eval.isInterrupted()) {
            throw new InterruptException(__eval.getStackTrace(), __eval.getCurrentAST().getLocation());
          }
          if (gens[i].hasNext() && gens[i].next()) {
            if (i == size - 1) {
              __eval.setCurrentAST(body);
              try {
View Full Code Here

Examples of org.rascalmpl.interpreter.control_exceptions.InterruptException

        while (change && (max == -1 || iterations < max)) {
          change = false;
          iterations++;
          if (__eval.isInterrupted()) {
            throw new InterruptException(__eval.getStackTrace(), __eval.getCurrentAST().getLocation());
          }
          bodyResult = body.interpret(__eval);
          for (int i = 0; i < size; i++) {
            QualifiedName var = vars[i];
            Result<IValue> v = __eval.getCurrentEnvt().getVariable(
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.