pyrser/ast/state.py
def to_dot(self) -> str:
        """
        Provide a '.dot' representation of all State in the register.
        """
        txt = ""
        txt += "digraph S%d {\n" % id(self)
        if self.label is not None:
            txt += '\tlabel="%s";\n' % (self.label + '\l').replace('\n', '\l')
        txt += "\trankdir=LR;\n"
        #txt += '\tlabelloc="t";\n'
        txt += '\tgraph [labeljust=l, labelloc=t, nojustify=true];\n'
        txt += "\tesep=1;\n"
        txt += '\tranksep="equally";\n'
        txt += "\tnode [shape = circle];\n"
        txt += "\tsplines = ortho;\n"
        for s in self.states.values():
            txt += s[1].to_dot()
        txt += "}\n"
        return txt
def to_dot(self) -> str:
        txt = ""
        txt += "digraph S%d {\n" % id(self)
        if self.label is not None:
            txt += '\tlabel="%s";\n' % (self.label + '\l').replace('\n', '\l')
        txt += "\trankdir=LR;\n"
        #txt += '\tlabelloc="t";\n'
        txt += '\tgraph [labeljust=l, labelloc=t, nojustify=true];\n'
        txt += "\tesep=1;\n"
        txt += '\tranksep="equally";\n'
        txt += "\tnode [shape = circle];\n"
        txt += "\tsplines = ortho;\n"
        for s in self.states.values():
            txt += s[1].to_dot()
        txt += "}\n"
        return txt
def to_dot ( self ) -> str : txt = "" txt += "digraph S%d {\n" % id ( self ) if self . label is not None : txt += '\tlabel="%s";\n' % ( self . label + '\l' ) . replace ( '\n' , '\l' ) txt += "\trankdir=LR;\n" #txt += '\tlabelloc="t";\n' txt += '\tgraph [labeljust=l, labelloc=t, nojustify=true];\n' txt += "\tesep=1;\n" txt += '\tranksep="equally";\n' txt += "\tnode [shape = circle];\n" txt += "\tsplines = ortho;\n" for s in self . states . values ( ) : txt += s [ 1 ] . to_dot ( ) txt += "}\n" return txt
Provide a '.dot' representation of all State in the register.
Provide a . dot representation of all State in the register .