Creates ProgramGraphs from a program or function's AST.
A ProgramGraph represents a Python program or function. The nodes in a ProgramGraph represent an Instruction (see instruction.py), an AST node, or a piece of syntax from the program. The edges in a ProgramGraph represent the relationships between these nodes.
Class |
|
A ProgramGraph represents a Python program or function. |
Class |
|
A single node in a Program Graph. |
Class |
|
An Unparser class helpful for creating Syntax Token nodes for fn graphs. |
Function | dump |
Undocumented |
Function | get |
Constructs a program graph to represent the given program. |
Function | is |
Undocumented |
Function | is |
Undocumented |
Function | is |
Undocumented |
Function | make |
Undocumented |
Function | make |
Undocumented |
Function | make |
Creates a program graph node for the provided AST node. |
Function | make |
Creates a ProgramGraphNode for the provided value. |
Function | make |
Creates a ProgramGraphNode corresponding to an existing Instruction. |
Function | make |
Undocumented |
Function | parse |
Undocumented |
Constant | INDENT |
Undocumented |
Constant | NEWLINE |
Undocumented |
Constant | UNINDENT |
Undocumented |
Creates a program graph node for the provided AST node.
This is only called when the AST node doesn't already correspond to an Instruction in the program's control flow graph.
Parameters | |
ast | An AST node from the program being analyzed. |
Returns | |
A node in the program graph corresponding to the AST node. |
Creates a ProgramGraphNode for the provided value.
value
is a primitive value appearing in a Python AST.
For example, the number 1 in Python has AST Num(n=1). In this, the value '1' is a primitive appearing in the AST. It gets its own ProgramGraphNode with node_type AST_VALUE.
Parameters | |
value | A primitive value appearing in an AST. |
Returns | |
A ProgramGraphNode corresponding to the provided value. |