println("       list = list.reverse();");
    private void genSeparatedListTypeFromTermMethod(SeparatedListType type) {        String className = ListTypeGenerator.className(type);        String elementType = type.getElementType();        String elementTypeName = TypeGenerator.className(elementType);        Separators separators = type.getSeparators();        String nextElement = buildGetNextElementCall(type);        String actualSeparators =            buildActualTypedAltArgumentList(type.separatorFieldIterator());        if (actualSeparators.length() > 0) {            actualSeparators += ", ";        }        // TODO: make this work for separators that are not palindromes, the reverse in         // combination with the match with the many pattern currently prevents this.        // Note that non-palindrome separators do not occur naturally anyway if the API is        // generated from an SDF definition        println("  public " + className + " " + className + "FromTerm(aterm.ATerm trm)");        println("  {");        println("     if (!(trm instanceof aterm.ATermList)) {");        println(            "       throw new RuntimeException(\"This is not a "                + className                + ": \" + trm);");        println("     }");        println("     aterm.ATermList list = ((aterm.ATermList) trm);");        println("     if (list.isEmpty()) {");        println("       return make" + className + "();");        println("     }");        println("     else if (list.getLength() == 1) {");        println(            "       return make"                + className                + "("                + elementTypeName                + "FromTerm(list.getFirst()));");        println("     }");        println("     else {");        println("       " + className + " result;");        println("       " + elementTypeName + " head;");        Iterator seps = type.separatorFieldIterator();        while (seps.hasNext()) {            Field sep = (Field) seps.next();            String fieldId = AlternativeImplGenerator.getFieldId(sep.getId());            String fieldType = TypeGenerator.className(sep.getType());            println("        " + fieldType + " " + fieldId + ";");        }        println(            "        java.util.List children = list.match(pattern"                + className                + "Many);");        println("        if (children != null) {");        genFromTermSeparatorHeadAssignment(type);         int tailIndex = genFromTermSeparatorFieldAssigments(type);        genFromTermSeparatorTailAssignment(tailIndex);        println("          result = make" + className + "(head);");        println("          while (children != null) {");        println("            children = list.match(pattern" + className + "Many);");        println("            if (children != null) {");        genFromTermSeparatorHeadAssignment(type);         println("              result = make"                + className                + "(head,"                + actualSeparators                + "result);");        tailIndex = genFromTermSeparatorFieldAssigments(type);        genFromTermSeparatorTailAssignment(tailIndex);        println("            }");        println("          }");        println("          if (list.getLength() == 1) {");        println("            return make" + className + "(" + elementTypeName + "FromTerm(list.getFirst()), " +        actualSeparators + "result);");        println("          }");        println("        }");        println("      }");        println("     throw new RuntimeException(\"This is not a " + className + ": \" + trm);");        println("  }");    }