Exemple #1
0
 @Override
 public Object getRelementImpl(int index) {
   if (index == 0) {
     String name = getBuiltin().getName();
     assert name == name.intern();
     return RDataFactory.createSymbol(name);
   } else {
     throw RInternalError.unimplemented();
   }
 }
Exemple #2
0
 public byte[] getData(String dbPath) {
   byte[] dbData = dbCache.get(dbPath);
   if (dbData == null) {
     try {
       dbData = Files.readAllBytes(FileSystems.getDefault().getPath(dbPath));
     } catch (IOException ex) {
       // unexpected
       throw RInternalError.shouldNotReachHere(ex);
     }
     dbCache.put(dbPath, dbData);
   }
   return dbData;
 }
Exemple #3
0
 protected RuntimeException fallback(Object fobj) {
   String name = null;
   if (fobj instanceof RList) {
     name = lookupName((RList) fobj);
     name = name == UNKNOWN_EXTERNAL_BUILTIN ? null : name;
     if (name != null && lookupBuiltin((RList) fobj) != null) {
       /*
        * if we reach this point, then the cache saw a different value for f. the lists
        * that contain the information about native calls are never expected to change.
        */
       throw RInternalError.shouldNotReachHere(
           "fallback reached for " + getRBuiltin().name() + " " + name);
     }
   }
   throw RError.nyi(
       this,
       getRBuiltin().name() + " specialization failure: " + (name == null ? "<unknown>" : name));
 }
Exemple #4
0
 @Override
 public final Object call(RArgsValuesAndNames args) {
   throw RInternalError.unimplemented("unimplemented external builtin: " + name);
 }
Exemple #5
0
 /** TODO the string is not really needed as all output is performed prior to the throw. */
 RError(String msg) {
   super(msg);
   verboseStackTrace = RInternalError.createVerboseStackTrace();
 }