我有一个 java 方法,我需要从方法声明中传递给这个方法的参数。下面的代码给出了应该提取方法声明但输出None我希望将提取的参数添加到字符串列表中。import ref = open("source_code.txt", "r")source_code = f.read()match = re.match("(public|protected|private|static|\s) +[\w\<\>\[\]]+\s+(\w+) *\([^\)]*\) *(\{?|[^;])", source_code)print(match)我想要这样的东西:输入:/** * Adds a subset of the edges of the specified source graph to the specified destination graph. * The behavior of this operation is undefined if either of the graphs is modified while the * operation is in progress. {@link #addEdgeWithVertices} is used for the transfer, so source * vertexes will be added automatically to the target graph. * * @param destination the graph to which edges are to be added * @param source the graph used as a source for edges to add * @param edges the edges to be added * @param <V> the graph vertex type * @param <E> the graph edge type * * @return <tt>true</tt> if this graph changed as a result of the call */public static <V, E> boolean addAllEdges(Graph<? super V, ? super E> destination, Graph<V, E> source, Collection<? extends E> edges) { boolean modified = false; for (E e : edges) { V s = source.getEdgeSource(e); V t = source.getEdgeTarget(e); destination.addVertex(s); destination.addVertex(t); modified |= destination.addEdge(s, t, e); } return modified; }这从方法声明中提取destination, source, :edgepublic static <V, E> boolean addAllEdges(Graph<? super V, ? super E> destination, Graph<V, E> source, Collection<? extends E> edges)输出:extracted_arguments = ['destination', 'source', 'edge']
添加回答
举报
0/150
提交
取消
