IncGraphXML¶
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)¶ Constructor.
Parameters: - theFig – The file include graph.
- theLineNum – The line number.
-
_writeSelf
(theS)¶ Plot me to a stream at the logical datum point. Must be provided by child classes.
-
finalise
()¶ This will be called on finalisation. This just accumulates the child token counter.
-
tokenCounter
¶ This is the computed PpTokenCount.PpTokenCount() me only.
-
tokenCounterChildren
¶ This is the computed PpTokenCount.PpTokenCount() for all my children but not me.
-
writeToFileObj
(theFileObj)¶ Root level call to plot to a file object. The SVG stream is created here.
-
writeToFilePath
(theFileName)¶ 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.
-
writeToSVGStream
(theS)¶ 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.