println("             throw new RuntimeException(\"Invalid element in " + typeName + ":\" + elem);");
println("             throw new RuntimeException(\"Invalid element in " + className + ":\" + tmp);");
	private void genFromTerm() {		String get_factory = staticFactoryGetter();		String className = ListTypeGenerator.className(type);		println("  public static " + className + " fromTerm(aterm.ATerm trm)");		println("  {");		println("     if (trm instanceof aterm.ATermList) {");		println("        aterm.ATermList list = ((aterm.ATermList) trm).reverse();");		println("        " + className + " tmp = (" + className + ") " + get_factory + ".make" + className + "();");		println("        for (; !list.isEmpty(); list = list.getNext()) {");		println("          " + elementTypeName + " elem = " + elementTypeName + ".fromTerm(list.getFirst());");		println("           if (elem != null) {");		println("             tmp = " + get_factory + ".make" + className + "(elem, tmp);");		println("           }");		println("           else {");		println("             throw new RuntimeException(\"Invalid element in " + typeName + ":\" + elem);");		println("           }");		println("        }");		println("        return tmp;");		println("     }");		println("     else {");		println("       throw new RuntimeException(\"This is not a " + typeName + ":\" + trm);");		println("     }");		println("  }");		ATermFactory f;	}