Examples of arity()


Examples of org.eclipse.imp.pdb.facts.IConstructor.arity()

   
    Map<String, IValue> kwParams = null;
    if (cons.mayHaveKeywordParameters() && cons.asWithKeywordParameters().hasParameters()) {
      kwParams = new HashMap<>();
    }
    if (cons.arity() == 0 && kwParams == null) {
      return subject; // constants have no children to traverse into
    }

    if (casesOrRules.hasAllConcretePatternCases() && TreeAdapter.isChar(cons)) {
        return subject; // we dont traverse into the structure of literals and characters
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IConstructor.arity()

    if (casesOrRules.hasAllConcretePatternCases() && TreeAdapter.isChar(cons)) {
        return subject; // we dont traverse into the structure of literals and characters
    }

    IValue args[] = new IValue[cons.arity()];

    if (casesOrRules.hasAllConcretePatternCases() && TreeAdapter.isAppl(cons)){
      // Constructor is "appl": we are dealing with a syntax tree
      // - Lexical or literal are returned immediately
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IConstructor.arity()

      }
    } else {
      // Constructor is not "appl", or at least one of the patterns is not a concrete pattern
      boolean hasChanged = false;
      boolean hasMatched = false;
      for (int i = 0; i < cons.arity(); i++){
        IValue child = cons.get(i);
        tr.matched = false;
        tr.changed = false;
        args[i] = traverseOnce(child, casesOrRules, direction, progress, fixedpoint, tr);
        hasChanged |= tr.changed;
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IConstructor.arity()

    }

    this.edges = new ArrayList<SpringGraphEdge>();
    for (IValue v : edges) {
      IConstructor c = (IConstructor) v;
      PropertyManager pm = c.arity() > 2 ? new PropertyManager(fpa, properties, (IList) c.get(2)) : properties;
      SpringGraphEdge e = FigureFactory.makeSpringGraphEdge(this, fpa, c, pm);
      this.edges.add(e);
      e.getFrom().addOut(e.getTo());
      e.getTo().addIn(e.getFrom());
    }
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IConstructor.arity()

        else if(name.equals("error"))
        color = FigureColorUtils.getErrorColor(2);
        else {
          int highlightKind = 0;
         
          if(lineDecor.arity() > 2){
            highlightKind = ((IInteger)lineDecor.get(2)).intValue();
            if(highlightKind < 0)
              highlightKind = 0;
            if(highlightKind >= FigureColorUtils.highlightColors.length)
              highlightKind = FigureColorUtils.highlightColors.length - 1;
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IConstructor.arity()

                    .__getEval().getStackTrace());
      }

      List<org.rascalmpl.ast.Assignable> arguments = this.getArguments();

      if (node.arity() != arguments.size()) {
        throw org.rascalmpl.interpreter.utils.RuntimeExceptionFactory
            .arityMismatch(node.arity(), arguments.size(), this,
                __eval.__getEval().getStackTrace());
      }
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IConstructor.arity()

      List<org.rascalmpl.ast.Assignable> arguments = this.getArguments();

      if (node.arity() != arguments.size()) {
        throw org.rascalmpl.interpreter.utils.RuntimeExceptionFactory
            .arityMismatch(node.arity(), arguments.size(), this,
                __eval.__getEval().getStackTrace());
      }

      IValue[] results = new IValue[arguments.size()];
      Type[] resultTypes = new Type[arguments.size()];
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IConstructor.arity()

      } else if (rec.getType().isNode()
          && subscript.getType().isInteger()) {
        int index = ((IInteger) subscript.getValue()).intValue();
        IConstructor node = (IConstructor) rec.getValue();

        if (index >= node.arity()) {
          throw org.rascalmpl.interpreter.utils.RuntimeExceptionFactory
              .indexOutOfBounds((IInteger) subscript.getValue(),
                  __eval.__getEval().getCurrentAST(), __eval
                      .__getEval().getStackTrace());
        }
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.INode.arity()

    out.beginArray();
    out.value("node");
    out.beginArray();
    INode n = (INode) value;
    out.value(n.getName());
    out.value(n.arity());
    out.beginArray();
    for (IValue v : n.getChildren()) {
      write(out, v);
    }
    out.endArray();
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.INode.arity()

    if (subjectType.isAbstractData()) {
      subjectType = ((IConstructor) this.subject).getConstructorType();
    }

    INode node = ((INode) this.subject);
    if (node.arity() != patternChildren.size()) {
      return; // that can never match
    }

    if (patternType.comparable(subjectType)) {
      hasNext = true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.