Package org.rascalmpl.interpreter.control_exceptions

Examples of org.rascalmpl.interpreter.control_exceptions.Throw


        throw RuntimeExceptionFactory.parseError(values.sourceLocation(e.getLocation(), e.getOffset(), e.getLength(), e.getBeginLine(), e.getEndLine(), e.getBeginColumn(), e.getEndColumn()), null, null);
      throw e;
    }
    catch (StaticError e) {
      if (forRascal) {
        throw new Throw(values.constructor(Exception_StaticError, values.string(e.getMessage()), e.getLocation()), (ISourceLocation) null, ctx.getStackTrace());
      }
      throw e;
    }
    catch (URISyntaxException e) {
      // this should never happen
View Full Code Here


    }
    catch (ParseError pe) {
      content.append(parseErrorMessage(command.getValue(), "stdin", pe));
      content.append('\n');
      ISourceLocation sourceLocation = values.sourceLocation(values.sourceLocation(pe.getLocation()), pe.getOffset(), pe.getLength(), pe.getBeginLine(), pe.getEndLine(), pe.getBeginColumn(), pe.getEndColumn());
      throw new Throw(values.constructor(ShellParseError, values.string(content.toString()), sourceLocation), ctx.getCurrentAST(), ctx.getStackTrace());
    }
    catch (QuitException q){
      //
    }
    catch(InterruptException i) {
      content.append(interruptedExceptionMessage(i));
      content.append('\n');
    }
    catch (Ambiguous e) {
      content.append(ambiguousMessage(e));
      content.append('\n');
      throw new Throw(values.constructor(ShellError, values.string(content.toString())), ctx.getCurrentAST(), ctx.getStackTrace());
    }
    catch(StaticError e){
      content.append(staticErrorMessage(e));
      content.append('\n');
      throw new Throw(values.constructor(ShellError, values.string(content.toString())), ctx.getCurrentAST(), ctx.getStackTrace());
    }
    catch(Throw e){
      content.append(throwMessage(e));
      content.append('\n');
      throw new Throw(values.constructor(ShellError, values.string(content.toString())), ctx.getCurrentAST(), ctx.getStackTrace());
    }
    catch(Throwable e){
      content.append(throwableMessage(e, eval != null ? ctx.getStackTrace() : null));
      content.append('\n');
      throw new Throw(values.constructor(ShellError, values.string(content.toString())), ctx.getCurrentAST(), ctx.getStackTrace());
    }
   
    return values.string(content.toString());
  }
View Full Code Here

    return vf.datetime(cal.getTimeInMillis());
  }

  @Override
  public IValue visitExternal(Type externalType) {
    throw new Throw(vf.string("Can't handle ExternalType."),
        (ISourceLocation) null, null);
  }
View Full Code Here

    return this.generate(rt.getType(maxDepth));
  }

  @Override
  public IValue visitVoid(Type type) {
    throw new Throw(vf.string("void has no values."),
        (ISourceLocation) null, null);
  }
View Full Code Here

    }
    catch (InvocationTargetException e) {
      Throwable targetException = e.getTargetException();
     
      if (targetException instanceof Throw) {
        Throw th = (Throw) targetException;
       
        StackTrace trace = new StackTrace();
        trace.addAll(th.getTrace());
       
        ISourceLocation loc = th.getLocation();
        if (loc == null) {
          loc = getAst().getLocation();
        }
        trace.add(loc, null);

        th.setLocation(loc);
        trace.addAll(eval.getStackTrace());
        th.setTrace(trace.freeze());
        throw th;
      }
      else if (targetException instanceof StaticError) {
        throw (StaticError) targetException;
      }
View Full Code Here

  public static Throw invalidUseOfLocation(String msg, AbstractAST ast, StackTrace trace) {
    return new Throw(VF.constructor(InvalidUseOfLocation, VF.string(msg)), ast, trace);
 
 
  public static Throw invalidUseOfDateException(String message, AbstractAST ast, StackTrace trace) {
    return new Throw(VF.constructor(InvalidUseOfDate, VF.string(message)), ast, trace);
  }
View Full Code Here

  public static Throw invalidUseOfDateException(String message, AbstractAST ast, StackTrace trace) {
    return new Throw(VF.constructor(InvalidUseOfDate, VF.string(message)), ast, trace);
  }
 
  public static Throw invalidUseOfTimeException(String message, AbstractAST ast, StackTrace trace) {
    return new Throw(VF.constructor(InvalidUseOfTime, VF.string(message)), ast, trace);
  }
View Full Code Here

  public static Throw invalidUseOfTimeException(String message, AbstractAST ast, StackTrace trace) {
    return new Throw(VF.constructor(InvalidUseOfTime, VF.string(message)), ast, trace);
  }
 
  public static Throw invalidUseOfDateTimeException(String message, AbstractAST ast, StackTrace trace) {
    return new Throw(VF.constructor(InvalidUseOfDateTime, VF.string(message)), ast, trace);
  }
View Full Code Here

//  public static Throw locationNotFound(ISourceLocation loc, AbstractAST ast, StackTrace trace) {
//    return new Throw(LocationNotFound.make(VF, loc), ast, trace);
//  }
 
  public static Throw malformedURI(String uri, Default x, StackTrace trace) {
    return new Throw(VF.constructor(MalFormedURI, VF.string(uri)), x, trace);
  }
View Full Code Here

  public static Throw malformedURI(String uri, Default x, StackTrace trace) {
    return new Throw(VF.constructor(MalFormedURI, VF.string(uri)), x, trace);
  }
 
  public static Throw MultipleKey(IValue v, AbstractAST ast, StackTrace trace) {
    return new Throw(VF.constructor(MultipleKey, v), ast, trace);
  }
View Full Code Here

TOP

Related Classes of org.rascalmpl.interpreter.control_exceptions.Throw

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.