Examples of arity()


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

    }
   
    // if the names are not ordered, then we order lexicographically on the arguments:
   
    int leftArity = left.arity();
    int rightArity = right.arity();
   
    if (leftArity < rightArity) {
      return new LessThanOrEqualResult(true, false, ctx);
    }
   
View Full Code Here

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

  private IValue traverseNodeOnce(IValue subject, CaseBlockList casesOrRules,
      DIRECTION direction, PROGRESS progress, FIXEDPOINT fixedpoint, TraverseResult tr) {
    IValue result;
    INode node = (INode)subject;
    if (node.arity() == 0 && !(node.mayHaveKeywordParameters() && node.asWithKeywordParameters().hasParameters()) ){
      result = subject;
    }
    else {
      IValue args[] = new IValue[node.arity()];
      Map<String, IValue> kwParams = null;
View Full Code Here

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

    INode node = (INode)subject;
    if (node.arity() == 0 && !(node.mayHaveKeywordParameters() && node.asWithKeywordParameters().hasParameters()) ){
      result = subject;
    }
    else {
      IValue args[] = new IValue[node.arity()];
      Map<String, IValue> kwParams = null;
      if (node.mayHaveKeywordParameters() && node.asWithKeywordParameters().hasParameters()) {
        kwParams = new HashMap<>();
      }
      boolean hasChanged = false;
View Full Code Here

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

        kwParams = new HashMap<>();
      }
      boolean hasChanged = false;
      boolean hasMatched = false;
     
      for (int i = 0; i < node.arity(); i++){
        IValue child = node.get(i);
        tr.changed = false;
        tr.matched = false;
        args[i] = traverseOnce(child, casesOrRules, direction, progress, fixedpoint, tr);
        hasChanged |= tr.changed;
View Full Code Here

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

  }
 
  @Override
  protected LessThanOrEqualResult lessThanOrEqualTuple(TupleResult that) {
    ITuple left = that.getValue();
    int leftArity = left.arity();
    ITuple right = getValue();
    int rightArity = right.arity();
   
    for (int i = 0; i < Math.min(leftArity, rightArity); i++) {
       IValue leftArg = left.get(i);
View Full Code Here

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

  @Override
  protected LessThanOrEqualResult lessThanOrEqualTuple(TupleResult that) {
    ITuple left = that.getValue();
    int leftArity = left.arity();
    ITuple right = getValue();
    int rightArity = right.arity();
   
    for (int i = 0; i < Math.min(leftArity, rightArity); i++) {
       IValue leftArg = left.get(i);
       IValue rightArg = right.get(i);
       LessThanOrEqualResult loe = makeResult(leftArg.getType(), leftArg, ctx).lessThanOrEqual(makeResult(rightArg.getType(), rightArg,ctx));
View Full Code Here

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

      } else if (rec.getType().isTuple()
          && subscript.getType().isInteger()) {
        int index = ((IInteger) subscript.getValue()).intValue();
        ITuple tuple = (ITuple) rec.getValue();

        if (index >= tuple.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.ITuple.arity()

    // {tuple: [ ... ]}
    out.beginArray()
      .value("tuple");
    out.beginArray();
    ITuple t = (ITuple) value;
    for (int i = 0; i < t.arity(); i++) {
      write(out, t.get(i));
    }
    out.endArray();
    out.endArray();
    return null;
View Full Code Here

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

  private IValue traverseTupleOnce(IValue subject, CaseBlockList casesOrRules,
      DIRECTION direction, PROGRESS progress, FIXEDPOINT fixedpoint, TraverseResult tr) {
    IValue result;
    ITuple tuple = (ITuple) subject;
    int arity = tuple.arity();
    IValue args[] = new IValue[arity];
    boolean hasMatched = false;
    boolean hasChanged = false;
   
   
View Full Code Here

Examples of org.ggp.base.util.gdl.grammar.GdlFunction.arity()

            //Just a constant
        }
        else if(gdl instanceof GdlFunction)
        {
            GdlFunction func = (GdlFunction)gdl;
            for(int i=0; i<func.arity(); i++)
            {
                Location parent = new Location();
                parent.name = func.getName();
                parent.idx = i;
                rval.addAll(findAllInstancesOf(var, func.get(i), parent));
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.