// The generic handler calls the specific handlers
  public ATerm handler(ATerm term) {
    List result;

    result = term.match(PrecMonitor0);
    if (result != null) {
      return recMonitor((ATerm) result.get(0));
      // return null;

    }
    result = term.match(PrecTerminate0);
    if (result != null) {
      recTerminate((ATerm) result.get(0));
      return null;
    }

    notInInputSignature(term);
    return null;
  }
Esempio n. 2
0
  protected boolean match(ATerm pattern, List<Object> list) {
    if (equals(pattern)) {
      return true;
    }

    if (pattern.getType() == ATerm.PLACEHOLDER) {
      ATerm type = ((ATermPlaceholder) pattern).getPlaceholder();
      if (type.getType() == ATerm.APPL) {
        ATermAppl appl = (ATermAppl) type;
        AFun afun = appl.getAFun();
        if (afun.getName().equals("real") && afun.getArity() == 0 && !afun.isQuoted()) {
          list.add(new Double(value));
          return true;
        }
      }
    }

    return super.match(pattern, list);
  }
  @Override
  // XXX(Leo_Roos;Nov 18, 2011) leads to many recursive calls, a possible
  // reason why there has to be such a big stack size in order to run
  // Tigerseye
  public Visitable visitList(ATermList arg) throws VisitFailure {
    // save annotations
    ATermList annotations = arg.getAnnotations();

    int childCount = arg.getChildCount();
    for (int i = 0; i < childCount; i++) {
      ATerm currentAterm = arg.elementAt(i);
      ATerm t = (ATerm) currentAterm.accept(this);

      if (t != currentAterm) {
        arg = arg.replace(t, i);
      }
    }

    // restore annotations
    arg = (ATermList) arg.setAnnotations(annotations);

    return arg;
  }
Esempio n. 4
0
 private boolean isColon(ATerm atm) {
   return atm.getType() == ATerm.APPL
       && (((ATermAppl) atm).getName().equals("Colon")
           || ((ATermAppl) atm).getName().equals("QuestionMark"));
 }