Package org.rascalmpl.interpreter.asserts

Examples of org.rascalmpl.interpreter.asserts.ImplementationError


    }
    else if (env == mod) {
      return mod;
    }
    else {
      throw new ImplementationError("Reinstantiating same module " + mod.getName());
    }
  }
View Full Code Here


      heap.removeModule(env);
      throw new ModuleImport(name, e.getMessage(), x);
    }

    heap.removeModule(env);
    throw new ImplementationError("Unexpected error while parsing module " + name + " and building an AST for it ", x);
  }
View Full Code Here

         return null;
      }

      @Override
       public IConstructor visitTreeAmb(IConstructor arg) {
         throw new ImplementationError("unexpected ambiguity: " + arg);
       }
     });
  }
View Full Code Here

          clazz = cl.loadClass(className);
          return (IGTD<IConstructor, IConstructor, ISourceLocation>) clazz.newInstance();
        } catch (ClassNotFoundException e) {
          continue;
        } catch (InstantiationException e) {
          throw new ImplementationError("could not instantiate " + className + " to valid IGTD parser", e);
        } catch (IllegalAccessException e) {
          throw new ImplementationError("not allowed to instantiate " + className + " to valid IGTD parser", e);
        }
      }
      throw new ImplementationError("class for cached parser " + className + " could not be found");
    }

    ParserGenerator pg = eval.getParserGenerator();
    IMap definitions = currentModule.getSyntaxDefinition();
   
    Class<IGTD<IConstructor, IConstructor, ISourceLocation>> parser = eval.getHeap().getObjectParser(currentModule.getName(), definitions);

    if (parser == null || force) {
      String parserName = currentModule.getName(); // .replaceAll("::", ".");

      parser = pg.getNewParser(eval, loc, parserName, definitions);
      eval.getHeap().storeObjectParser(currentModule.getName(), definitions, parser);
    }

    try {
      return parser.newInstance();
    } catch (InstantiationException e) {
      throw new ImplementationError(e.getMessage(), e);
    } catch (IllegalAccessException e) {
      throw new ImplementationError(e.getMessage(), e);
    } catch (ExceptionInInitializerError e) {
      throw new ImplementationError(e.getMessage(), e);
    }
  }
View Full Code Here

                return (IConstructor) ((INode) arg).get(0);
              }
            }
          }
         
          throw new ImplementationError("expected to find a holeType, but did not: " + tree);
        }

        @Override
        public IConstructor visitTreeAmb(IConstructor arg)  {
          ISetWriter w = vf.setWriter();
View Full Code Here

    }
    catch (FactTypeRedeclaredException e) {
      throw new RedeclaredType(e.getName(), x);
    }
    catch (FactTypeDeclarationException e) {
      throw new ImplementationError("Unknown FactTypeDeclarationException: " + e.getMessage());
    }
  }
View Full Code Here

        for(Map.Entry<Type, ITask<Type, IValue, IValue>> t : producerMap.entrySet()) {
          if(nameType.isSubtypeOf(t.getKey()))
            return t.getValue();
        }
      }
      throw new ImplementationError("No suitable producer found for " + key + "(" + name + ")");
    }
    finally {
      lock.unlock();
    }
  }
View Full Code Here

    }
    finally {
      lock.unlock();
    }
    if(producer == null)
      throw new ImplementationError("No registered fact producer for " + key.toString());
    return producer.produce(monitor, tr, key, name);
  }
View Full Code Here

    }
    finally {
      lock.unlock();
    }
    if(producer == null)
      throw new ImplementationError("No registered fact producer for " + key.toString());
    return producer.produce(monitor, tr, key, name);
  }
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

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.