Package org.rascalmpl.interpreter.asserts

Examples of org.rascalmpl.interpreter.asserts.ImplementationError


      IString classString = (IString) evaluator.call(monitor, "generateObjectParser", vf.string(packageName), vf.string(normName), grammar);
      debugOutput(classString.getValue(), System.getProperty("java.io.tmpdir") + "/parser.java");
      monitor.event("Compiling generated java code: " + name, 30);
      return bridge.compileJava(loc, packageName + "." + normName, classString.getValue());
    catch (ClassCastException e) {
      throw new ImplementationError("parser generator:" + e.getMessage(), e);
    } catch (Throw e) {
      throw new ImplementationError("parser generator: " + e.getMessage() + e.getTrace());
    } finally {
      monitor.endJob(true);
    }
  }
View Full Code Here


      IString classString = (IString) evaluator.call(monitor, "generateMetaParser", vf.string(packageName), vf.string("$Rascal_" + normName), vf.string(packageName + "." + normName), grammar);
      debugOutput(classString.getValue(), System.getProperty("java.io.tmpdir") + "/metaParser.java");
      monitor.event("compiling generated java code: " + name, 10);
      return bridge.compileJava(loc, packageName + ".$Rascal_" + normName, objectParser.getClass(), classString.getValue());
    catch (ClassCastException e) {
      throw new ImplementationError("meta parser generator:" + e.getMessage(), e);
    } catch (Throw e) {
      throw new ImplementationError("meta parser generator: " + e.getMessage() + e.getTrace());
    }
  }
View Full Code Here

      monitor.event("Importing and normalizing grammar:" + name, 30);
      IConstructor grammar = getGrammar(monitor, name, definition);
      debugOutput(grammar.toString(), System.getProperty("java.io.tmpdir") + "/grammar.trm");
      return getNewParser(monitor, loc, name, grammar);
    catch (ClassCastException e) {
      throw new ImplementationError("parser generator:" + e.getMessage(), e);
    } catch (Throw e) {
      throw new ImplementationError("parser generator: " + e.getMessage() + e.getTrace());
    } finally {
      monitor.endJob(true);
    }
   
  }
View Full Code Here

      IString classString = (IString) evaluator.call(monitor, "newGenerate", vf.string(packageName), vf.string(normName), grammar);
      debugOutput(classString.getValue(), System.getProperty("java.io.tmpdir") + "/parser.java");
      monitor.event("Compiling generated java code: " + name, 30);
      return bridge.compileJava(loc, packageName + "." + normName, classString.getValue());
    catch (ClassCastException e) {
      throw new ImplementationError("parser generator:" + e.getMessage(), e);
    } catch (Throw e) {
      throw new ImplementationError("parser generator: " + e.getMessage() + e.getTrace());
    } finally {
      monitor.endJob(true);
    }
  }
View Full Code Here

      } catch (FactTypeUseException e) {
        throw new DateTimeSyntax(e.getMessage(), eval.getCurrentAST().getLocation());
      } catch (FactParseError e) {
          throw new DateTimeSyntax(e.getMessage(), eval.getCurrentAST().getLocation());
      } catch (IOException e) {
        throw new ImplementationError(e.getMessage());
      }
    }
View Full Code Here

 
  private IValue eval(IRascalMonitor monitor, String cmd) {
    try {
      return eval.eval(monitor, cmd, URIUtil.rootScheme("checker")).getValue();
    } catch (ParseError pe) {
      throw new ImplementationError("syntax error in static checker modules", pe);
    }
  }
View Full Code Here

    return mod; 
  }
 
  public void startShell(IEvaluatorContext ctx) {
    if (old != null || env != null) {
      throw new ImplementationError("Can not nest shell calls! Call endShell before another startShell please.");
    }
    evaluator = createEvaluator(ctx);
    old = evaluator.getCurrentEnvt();
    env = getUniqueModuleEnvironment(evaluator);
    evaluator.setCurrentEnvt(env);
View Full Code Here

    old = null;
  }
 
  public IString shell(IString command, IInteger duration, IEvaluatorContext ctx) {
    if (evaluator == null || old == null || env == null) {
      throw new ImplementationError("First call startShell, then shell, then end with endShell");
    }
   
    IValue valueType = tr.typeToValue(TypeFactory.getInstance().valueType(), ctx).getValue();
    StringBuilder content = new StringBuilder();
   
View Full Code Here

   */
  protected static Transaction transaction(IValue tr) {
    if(tr instanceof Transaction)
      return (Transaction)tr;
    else
      throw new ImplementationError("Not a transaction: " + tr);
  }
View Full Code Here

  public OverloadedFunction(String name, Type type, List<AbstractFunction> candidates, List<AbstractFunction> defaults, IEvaluatorContext ctx) {
    super(type, null, ctx);

    if (candidates.size() + defaults.size() <= 0) {
      throw new ImplementationError("at least need one function");
    }
    this.name = name;

    this.primaryCandidates = new ArrayList<AbstractFunction>(candidates.size());
    this.defaultCandidates = new ArrayList<AbstractFunction>(candidates.size());
View Full Code Here

TOP

Related Classes of org.rascalmpl.interpreter.asserts.ImplementationError

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.