JavaGenerationParameters params = getJavaGenerationParameters(); String returnTypeName = TypeGenerator.qualifiedClassName(params, type); String className = TypeGenerator.className(type); String elementType = type.getElementType(); String elementTypeName = TypeGenerator.qualifiedClassName(params, elementType); String fromTermMethodName = TypeGenerator.className(elementType) + "FromTerm";
JavaGenerationParameters params = getJavaGenerationParameters(); String returnTypeName = TypeGenerator.qualifiedClassName(params, type); String className = TypeGenerator.className(type); String elementType = type.getElementType(); String elementTypeName = TypeGenerator.qualifiedClassName(params, elementType); String nextElement;
	private void genFactoryListTypeFromTerm(NormalListType type) {		JavaGenerationParameters params = getJavaGenerationParameters();		String returnTypeName = TypeGenerator.qualifiedClassName(params, type);		String className = TypeGenerator.className(type);		String elementType = type.getElementType();		String elementTypeName = TypeGenerator.qualifiedClassName(params, elementType);		String fromTermMethodName = TypeGenerator.className(elementType) + "FromTerm";		if (getConverter().isReserved(elementType)) {			// TODO: implement lists of builtins			throw new RuntimeException("List of " + elementType + " not yet implemented, sorry!");		}		println("  public " + returnTypeName + " " + className + "FromTerm(aterm.ATerm trm) {");		println("     if (trm instanceof aterm.ATermList) {");		println("        aterm.ATermList list = ((aterm.ATermList) trm).reverse();");		println("        " + returnTypeName + " result = make" + className + "();");		println("        for (; !list.isEmpty(); list = list.getNext()) {");		println("          " + elementTypeName + " elem = " + fromTermMethodName + "(list.getFirst());");		println("           if (elem != null) {");		println("             result = make" + className + "(elem, result);");		println("           }");		println("           else {");		println("             throw new RuntimeException(\"Invalid element in " + className + ": \" + elem);");		println("           }");		println("        }");		println("        return result;");		println("     }");		println("     else {");		println("       throw new RuntimeException(\"This is not a " + className + ": \" + trm);");		println("     }");		println("  }");		println();	}