public String generateCode() {
		String code = "";

		String ident = "    ";

		// Function description (commented)
		for (int i = 0; i < descDoc.size(); i++) {
			code += ("// " + descDoc.get(i));
		}

		code += ("function " + toString() + "{\n\n");

		// Variables
		for (int i = 0; i < variables.size(); i++) {
			code += (ident + "var " + variables.get(i) + ";");

			String comm = ((Variable) variables.get(i)).commentDoc.getDoc();

			if (comm.length() > 0) {
				code += (" /** " + comm + " */");
			}

			code += "\n";
		}

		code += "\n";

		// Body
		for (int i = 0; i < body.size(); i++)
			code += (ident + body.get(i) + "\n");

		code += "\n";

		code += "}\n";

		return code;
	}