ó ;œPc@ssdZdefd„ƒYZdd d„ƒYZd„Zd„Zd„Zd„Zd seed kroeƒnd S( s¨ Handling of tree structures given in a special 'dotted' syntax. This represents trees of nodes with strings as tags, in a readable and writable and easy to parse syntax. There are two main functions, unparse_sexpr and parse_string. When parsing, the result is by default given in 'sexpr' format: each node is a tuple of the form (tag, ) or (tag, node) or (tag, node, node) ... The following invariant is intended to hold for every node x, parse_string(unparse_sexpr(x)) == x Currently the following invariant has been tested for some strings: unparse_sexpr(parse_string(s)).strip() == s.strip() [It only holds on stripped results but may be fixed sometime.] tNodecBs)eZdZd„Zd„Zd„ZRS(ttagtchildrentindexcCs||_||_||_dS(N(RRR(tselfRRR((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyt__init__s  cCs0|jftg|jD]}|jƒ^qƒS(N(RttupleRtas_sexpr(Rtc((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyR!scCs#d|jj|j|j|jfS(Ns%s(%r, %r, %r)(t __class__t__name__RRR(R((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyt__repr__$s  (RRR(R t __module__t __slots__RRR (((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyRs  t _GLUECLAMP_cBsƒeZdZdZdZdZd„Zd„ZeZdd„Z dd„Z dd „Z dd „Z d „Zd „Zd „ZRS(s_parent.FileIO:IOtnodetdotchart.s\cCs|ft|ƒS(N(R(RRRt lineindex((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyt node_sexprIscCst|t|ƒ|ƒS(N(RR(RRRR((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyt node_nodeTscCs|j|jj|ƒ|ƒS(N(t parse_stringtIOt read_file(Rtfiletsrc((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyt parse_fileYscCsý|j}|j}g}|} xUy|jƒ\}} Wntk rQd} PnX| j|ƒsq|j| ƒq!Pq!Wx[t|ƒD]M\} } | j||ƒs¹| j|||ƒrƒ| t|ƒ|| (R>(R?(R(R>(R>(sba x(RA(R(R(s\(s \(s\.(s tag(RB(s (s a(stype A(sclatex ~\ ..~|begincolorbox|~raw::~LaTeX~\ ~\ ~~~{ extbackslash}{ extbackslash}begin{\{}center{\}}~\(scontains DottedTree (tguppyR=tgslt DottedTreeRRRR3RR.tstripRRRLRF(R=tparseR:R8tytzR+((RIRJRKRLsG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyttest_1ºsT              (    cCs¦ddlm}|ƒjjj}|j}|j}|dƒ}tdtdtdd dƒfdƒtd d d ƒfd ƒ}t|ƒt|ƒkst‚|GHdS(Niÿÿÿÿ(R=s'line 0 .line 1 ..line 2 line 3 .line 4 sline 0sline 1s line 2 line 3iisline 4 ii((( RMR=RNRORR4RtreprR.(R=RJRQR:Rtexp((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyttest_2s   cCs+ddl}ddl}|j|jjƒS(Niÿÿÿÿ(tdoctesttguppy.gsl.DottedTreettestmodRNRO(RXRM((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyt test_doctest/scCstƒtƒdS(N(RTRW(((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pyt test_main3sit__main__N(( t__doc__tobjectRRRTRWR[R\R (((sG/opt/alt/python27/lib64/python2.7/site-packages/guppy/gsl/DottedTree.pytsŒ Z