}
}
private String genGetterSteps(Iterator<Step> steps, String arg) {
if (steps.hasNext()) {
Step step = steps.next();
int index = step.getIndex();
switch (step.getType()) {
case Step.ARG:
return genGetterSteps(steps, "ATgetArgument((ATermAppl)" + arg
+ ", " + step.getIndex() + ")");
case Step.ELEM:
if (index == 0) {
return genGetterSteps(steps, "ATgetFirst((ATermList)" + arg
+ ")");
}
return genGetterSteps(steps, "ATelementAt((ATermList)" + arg
+ ", " + step.getIndex() + ")");
case Step.TAIL:
if (index == 0) {
return genGetterSteps(steps, arg);
} else if (index == 1) {
return genGetterSteps(steps, "ATgetNext((ATermList)" + arg
+ ")");
} else {
return genGetterSteps(steps, "ATgetTail((ATermList)" + arg
+ ", " + step.getIndex() + ")");
}
}
}
return arg;