Package org.rascalmpl.interpreter.asserts

Examples of org.rascalmpl.interpreter.asserts.ImplementationError


    }
    else if (ast instanceof VoidClosure) {
      params = ((VoidClosure) ast).getParameters();
    }
    else {
      throw new ImplementationError("Unexpected kind of Rascal function: " + ast);
    }
   
    formals = params.getFormals().getFormals();
   
    if (params.isVarArgs() && formals.size() > 0) {
View Full Code Here


  ListPattern(IEvaluatorContext ctx, AbstractAST x, List<IMatchingResult> list, int delta){
    super(ctx, x);

    if(delta < 1)
      throw new ImplementationError("Wrong delta");
    this.delta = delta;
    this.patternChildren = list;         
    this.patternSize = list.size();
    this.reducedPatternSize = (patternSize + delta - 1) / delta;
View Full Code Here

          this);
    }

    @Override
    public IMatchingResult buildMatcher(IEvaluatorContext __eval) {
      throw new ImplementationError("Map in pattern not yet implemented");
    }
View Full Code Here

    return tree.getConstructorType() == Factory.Tree_Appl;
  }

  private static int findLabelPosition(IConstructor tree, String label) {
    if (!TreeAdapter.isAppl(tree)) {
      throw new ImplementationError("can not call getArg on a non-tree");
    }
   
    IConstructor prod = TreeAdapter.getProduction(tree);

    if (!ProductionAdapter.isDefault(prod)) {
View Full Code Here

      return (IConstructor) tree.get("symbol");
    }
    else if (isAmb(tree)) {
      return getType((IConstructor) getAlternatives(tree).iterator().next());
    }
    throw new ImplementationError("Tree does not have a type");
  }
View Full Code Here

  public static IList getArgs(IConstructor tree) {
    if (isAppl(tree)) {
      return (IList) tree.get("args");
    }

    throw new ImplementationError("Node has no args: " + tree.getName());
  }
View Full Code Here

  public static IConstructor setArgs(IConstructor tree, IList args) {
    if (isAppl(tree)) {
      return tree.set("args", args);
    }

    throw new ImplementationError("Node has no args: " + tree.getName());
  }   
View Full Code Here

  public static IConstructor setProduction(IConstructor tree, IConstructor prod) {
    if (isAppl(tree)) {
      return tree.set("prod", prod);
    }

    throw new ImplementationError("Node has no args: " + tree.getName());
  }
View Full Code Here

        : false;
  }

  public static IList getListASTArgs(IConstructor tree) {
    if (!isList(tree)) {
      throw new ImplementationError(
          "This is not a context-free list production: " + tree);
    }
    IList children = getArgs(tree);
    IListWriter writer = ValueFactoryFactory.getValueFactory().listWriter(Factory.Args.getElementType());
View Full Code Here

    if (SymbolAdapter.isStartSort(TreeAdapter.getType(tree))) {
      return getArgs(tree).delete(0).delete(1);
    }
   
    if (isLexical(tree)) {
      throw new ImplementationError("This is not a context-free production: " + tree);
    }

    IList children = getArgs(tree);
    IListWriter writer = ValueFactoryFactory.getValueFactory().listWriter(Factory.Args.getElementType());
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.