printDocReturn("|arg| reversed");
printDocReturn("#arg reversed");
	private void genSeparatedReverse(SeparatedListType type, String typeId,			String typeName) {		String decl = typeName + " " + prefix + "reverse" + typeId + "("				+ typeName + " arg)";		String listNext = "      list = ATgetNext(list);";		int sepCount = type.getSeparators().getLength();		hprintln(decl + ";");				printDocHead("Reverses the elements of a " + typeName, "Note that separators are reversed with the list, but the order in which each set of separators inbetween two elements occurs does not change");		printDocArg("arg", typeName + " to be reversed");		printDocReturn("|arg| reversed");		printDocTail();		println(decl + " {");		println("  ATermList list = (ATermList) arg;");		println("  ATerm head;");		for (int i = 0; i < sepCount; i++) {			println("  ATerm sep" + i + ";");		}		println("  ATermList result;");		println();		println(" if (ATisEmpty(list) || ATgetLength(list) == 1) {");		println("    return arg;");		println("  }");		println();		println("  result = ATmakeList1(ATgetFirst(list));");		println(listNext);		for (int i = 0; i < sepCount; i++) {			println("  sep" + i + " = ATgetFirst(list);");			println("  list = ATgetNext(list);");		}		println();		println("  while (!ATisEmpty(list)) {");		for (int i = sepCount - 1; i >= 0; i--) {			println("    result = ATinsert(result, sep" + i + ");");		}		println();		println("   head = ATgetFirst(list);");		println("   result = ATinsert(result, head);");		println("    list = ATgetNext(list);");		println();		println("   if (!ATisEmpty(list)) {");		for (int i = 0; i < sepCount; i++) {			println("  sep" + i + " = ATgetFirst(list);");			println("  list = ATgetNext(list);");		}		println("   }");		println("  }");		println();		println("  return (" + typeName + ") result;");		println("}");		println();	}