7.5.4. Cross Access: IR and RFG¶
Some IR nodes have a direct pendant in the RFG file and vice versa. The IR scripting API can be used to connect IR graphs with their pendant in an RFG graph.
7.5.4.1. Setting Up IR and RFG Graphs¶
For obtaining the IR node that corresponds to a given RFG node, you can use the following method of the IR Graph class:
node(rfg_node)
It takes as input an RFG node and returns the corresponding IR node (or a Node object that evaluates to False if no corresponding IR node is present).
For the other way around, i. e. obtaining the RFG node corresponding to a given IR node, you can use the following methods, also members of the IR Graph class:
The method connect takes an RFG graph and performs a connection with the IR graph. The connection can be released by the method disconnect.
After the IR graph has been (and still is) connected to the RFG, you can use the method