return super.match(pattern, list);
}
public ATerm make(List<Object> args) {
ATermAppl appl;
AFun fun;
String name;
appl = (ATermAppl) type;
fun = appl.getAFun();
name = fun.getName();
if (!fun.isQuoted()) {
if (fun.getArity() == 0) {
if (name.equals("term")) {
ATerm t = (ATerm) args.get(0);
args.remove(0);
return t;
} else if (name.equals("list")) {
ATermList l = (ATermList) args.get(0);
args.remove(0);
return l;
} else if (name.equals("bool")) {
Boolean b = (Boolean) args.get(0);
args.remove(0);
return factory.makeAppl(factory.makeAFun(b.toString(), 0,
false));
} else if (name.equals("int")) {
Integer i = (Integer) args.get(0);
args.remove(0);
return factory.makeInt(i.intValue());
} else if (name.equals("real")) {
Double d = (Double) args.get(0);
args.remove(0);
return factory.makeReal(d.doubleValue());
} else if (name.equals("blob")) {
byte[] data = (byte[]) args.get(0);
args.remove(0);
return factory.makeBlob(data);
} else if (name.equals("placeholder")) {
ATerm t = (ATerm) args.get(0);
args.remove(0);
return factory.makePlaceholder(t);
} else if (name.equals("str")) {
String str = (String) args.get(0);
args.remove(0);
return factory.makeAppl(factory.makeAFun(str, 0, true));
} else if (name.equals("id")) {
String str = (String) args.get(0);
args.remove(0);
return factory.makeAppl(factory.makeAFun(str, 0, false));
} else if (name.equals("fun")) {
String str = (String) args.get(0);
args.remove(0);
return factory.makeAppl(factory.makeAFun(str, 0, false));
}
}
if (name.equals("appl")) {
ATermList oldargs = appl.getArguments();
String newname = (String) args.get(0);
args.remove(0);
ATermList newargs = (ATermList) oldargs.make(args);
AFun newfun = factory.makeAFun(newname, newargs.getLength(),
false);
return factory.makeApplList(newfun, newargs);
}
}
throw new RuntimeException("illegal pattern: " + this);