PCART  v1.4
Automated Repair of Python API Parameter Compatibility Issues
Public Member Functions | List of all members
GetFuncCall Class Reference

Extract all call type nodes from a project source file 抽取项目源码中的所有call类型节点 More...

Public Member Functions

def __init__ (self)
 Initialize the function call list 初始化函数调用列表 More...
 
def dfsVisit (self, node)
 Depth-first search visit that extracts Call nodes 深度优先遍历,提取Call节点 More...
 
def func_call (self)
 Return collected function call tuples 返回收集到的函数调用元组 More...
 

Detailed Description

Extract all call type nodes from a project source file 抽取项目源码中的所有call类型节点

Use a DFS algorithm to traverse the call type node from the root node. Each API call is stored in a tuple (API name, parameters, call statement, line/column span) 从根节点开始,直接找根节点的孩子,Call存在于Expr和Assign节点中。每个API调用存储调用语句及其行列位置

Definition at line 65 of file extractCall.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)

Initialize the function call list 初始化函数调用列表

Definition at line 68 of file extractCall.py.

Member Function Documentation

◆ dfsVisit()

def dfsVisit (   self,
  node 
)

Depth-first search visit that extracts Call nodes 深度优先遍历,提取Call节点

Terminates when a Call node is found or the current node has no children. 结束条件:遇到Call节点或当前节点无子节点

Parameters
nodeThe AST node to traverse
Returns
None

Definition at line 86 of file extractCall.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ func_call()

func_call (   self)

Return collected function call tuples 返回收集到的函数调用元组

Returns
list of (call_name, parameters, call_state, lineno, col_offset, end_lineno, end_col_offset) tuples

Definition at line 76 of file extractCall.py.


The documentation for this class was generated from the following file: