Package org.rascalmpl.interpreter.asserts

Examples of org.rascalmpl.interpreter.asserts.ImplementationError


    return mayMatch(getType(env, null), subjectType);
  }
 
  protected void checkInitialized(){
    if(!initialized){
      throw new ImplementationError("hasNext or match called before initMatch", ast.getLocation());
    }
  }
View Full Code Here


        m.put(dumpYAMLrec((IConstructor)e.getKey(), visited, ctx),
            dumpYAMLrec((IConstructor)e.getValue(), visited, ctx));
      }
      return m;
    }
    throw new ImplementationError("Invalid YAML data type: " + yaml);
  }
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

    else if (cons.getConstructorType() == Factory.Tree_Amb) {
      IConstructor first = (IConstructor) TreeAdapter.getAlternatives(cons).iterator().next();
      this.symbol = TreeAdapter.getType(first);
    }
    else {
      throw new ImplementationError("Invalid concrete syntax type constructor:" + cons);
    }
  }
View Full Code Here

  }
 
  @Override
  public Result<IValue> next(){
    if(iterator == null){
      throw new ImplementationError("next called on Result with null iterator");
    }
    return iterator.next(); //??? last = iterator.next();
  }
View Full Code Here

    return iterator.next(); //??? last = iterator.next();
  }

  @Override
  public void remove() {
    throw new ImplementationError("remove() not implemented for (iterable) result");   
  }
View Full Code Here

    @Override
    public Result<IValue> interpret(IEvaluator<Result<IValue>> __eval) {
      Result<IValue> value = stat.interpret(__eval);
      if (!value.getType().isList()) {
        throw new ImplementationError(
            "template eval returns non-list");
      }
      IList list = (IList) value.getValue();
      if (list.length() == 0) {
        System.out.println("bla");
      }

      if (!list.get(0).getType().isString()) {
        throw new ImplementationError(
            "template eval returns list with non-string");
      }
     
      return ResultFactory.makeResult(TF.stringType(), list.get(0), __eval);
     
View Full Code Here

   
    @Override
    public ListOrRelationResult<IList> visitList(Type type) {
      if(declaredType.isListRelation()) {
        if (value != null && !(value.getType().isListRelation()))
          throw new ImplementationError("somehow a list relation value turned into a list, but its type did not change with it", ctx.getCurrentAST().getLocation());
        return new ListRelationResult(declaredType, (IList)value, ctx);
      }

      return new ListResult(declaredType, (IList)value, ctx);
    }
View Full Code Here

   
    @Override
    public SetOrRelationResult<ISet> visitSet(Type type) {
      if(declaredType.isRelation()) {
        if (value != null && !(value.getType().isRelation()))
          throw new ImplementationError("somehow a relation value turned into a set, but its type did not change with it", ctx.getCurrentAST().getLocation());
        return new RelationResult(declaredType, (ISet)value, ctx);
      }
     
      return new SetResult(declaredType, (ISet)value, ctx);
    }
View Full Code Here

  public LessThanOrEqualResult(boolean less, boolean equal, IEvaluatorContext ctx) {
    super(TypeFactory.getInstance().boolType(), ctx.getValueFactory().bool(less || equal), ctx);
    this.less = less;
    this.equal = equal;
    if (less && equal) {
      throw new ImplementationError("something can not be both less and equal at the same time");
    }
  }
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.