public ATerm getPattern() {
return pattern;
}
public int getPatternType() {
ATerm match_pattern = buildMatchPattern();
if (match_pattern.getType() == ATerm.PLACEHOLDER) {
ATerm ph = ((ATermPlaceholder) match_pattern).getPlaceholder();
if (ph.match("int") != null) {
return ATerm.INT;
} else if (ph.match("real") != null) {
return ATerm.REAL;
} else if (ph.match("str") != null) {
return ATerm.APPL;
} else if (ph.match("list") != null) {
return ATerm.LIST;
} else if (ph.match("term") != null) {
return ATerm.APPL;
} else if (ph.match("chars") != null) {
return ATerm.LIST;
} else if (ph.match("char") != null) {
return ATerm.INT;
} else {
throw new RuntimeException("strange root pattern: "
+ match_pattern);
}