Class BlockGraph

    • Constructor Detail

      • BlockGraph

        public BlockGraph()
    • Method Detail

      • addBlock

        public void addBlock​(PcodeBlock bl)
        Add a block to this container. There are (initially) no edges between it and any other block in the container.
        Parameters:
        bl - is the new block to add
      • setIndices

        public void setIndices()
        Assign a unique index to all blocks in this container. After this call, getBlock(i) will return the block that satisfies block.getIndex() == i
      • getSize

        public int getSize()
        Returns:
        the number of blocks in this container
      • getBlock

        public PcodeBlock getBlock​(int i)
        Retrieve the i-th block from this container
        Parameters:
        i - is the index of the block to fetch
        Returns:
      • addEdge

        public void addEdge​(PcodeBlock begin,
                            PcodeBlock end)
        Add a directed edge between two blocks in this container
        Parameters:
        begin - is the "from" block of the edge
        end - is the "to" block of the edge
      • transferObjectRef

        public void transferObjectRef​(BlockGraph ingraph)
        Recursively run through this structured BlockGraph finding the BlockCopy leaves. Using the BlockCopy altindex, lookup the original BlockCopy in -ingraph- and transfer the Object ref and Address into the leaf
        Parameters:
        ingraph - is the original flow graph
      • saveXmlBody

        public void saveXmlBody​(java.io.Writer writer)
                         throws java.io.IOException
        Description copied from class: PcodeBlock
        Serialize information about the block to XML, other than header and edge info
        Overrides:
        saveXmlBody in class PcodeBlock
        Parameters:
        writer - is where to serialize to
        Throws:
        java.io.IOException - if there is a problem with the stream
      • restoreXml

        public void restoreXml​(XmlPullParser parser,
                               AddressFactory factory)
                        throws PcodeXMLException
        Restore all blocks and edges in this container from an XML stream.
        Parameters:
        parser - is the XML stream parser
        factory - is the AddressFactory used to construct any Address
        Throws:
        PcodeXMLException - if part of the XML description is invalid