Generates an XML file from an include graph.

This is implemented as a hierarchical visitor pattern. This could have be implemented as a non-hierarchical visitor pattern using less memory at the expense of more code.

class cpip.IncGraphXML.IncGraphXML(theFig, theLineNum)

Class that creates an include graph in XML.

__init__(theFig, theLineNum)


  • theFig – The file include graph.
  • theLineNum – The line number.

Plot me to a stream at the logical datum point. Must be provided by child classes.


This will be called on finalisation. This just accumulates the child token counter.


This is the computed PpTokenCount.PpTokenCount() me only.


This is the computed PpTokenCount.PpTokenCount() for all my children but not me.


Root level call to plot to a file object. The SVG stream is created here.


Root level call to plot to a SVG file, theTpt is an TreePlotTransform object and is used to transform the internal logical coordinates to physical plot positions.


Write me to a stream and my children at the logical datum point, this is a recursive call.

cpip.IncGraphXML.processIncGraphToXml(theLex, theFilePath)

Convert a Include graph from a PpLexer to SVG in theFilePath.