+
    VBiV                     d    R t ^ RIt^RIHt R	t]) t ! R R4      t ! R R4      t ! R R4      tR# )
z=
Python Lexical Analyser

Classes for building NFAs and DFAs
N)TransitionMapc                   N   a  ] tR t^t o RtR tR tR tR tR t	R t
R tR	tV tR
# )Machinez1A collection of Nodes representing an NFA or DFA.c                0    . V n         / V n        ^V n        R# )   N)statesinitial_statesnext_state_numberselfs   &9/usr/lib/python3.14/site-packages/Cython/Plex/Machines.py__init__Machine.__init__   s     !"    c                L    V P                    F  pVP                  4        K  	  R # N)r   destroyr   states   & r   __del__Machine.__del__   s    [[EMMO !r   c                    \        4       pV P                  pV^,           V n        W!n        V P                  P	                  V4       V# )z-Add a new state to the machine and return it.)Noder	   numberr   append)r   sns   &  r   	new_stateMachine.new_state   s<    F#55!"Q1r   c                H    V P                  4       pV P                  W4       V# r   )r   make_initial_stater   namer   s   && r   new_initial_stateMachine.new_initial_state#   s!     ,r   c                "    W P                   V&   R # r   r   r!   s   &&&r   r    Machine.make_initial_state(       $)D!r   c                (    V P                   V,          # r   r&   r   r"   s   &&r   get_initial_stateMachine.get_initial_state+       ""4((r   c                L   VP                  R 4       V P                  ea   VP                  R4       \        V P                  P                  4       4       F(  w  r#VP                  RW#P                  3,          4       K*  	  V P
                   F  pVP                  V4       K  	  R# )zPlex.Machine:
N   Initial states:
z      '%s': %d
)writer   sorteditemsr   r   dump)r   filer"   r   r   s   &&   r   r3   Machine.dump.   s{    

$%*JJ-.!'(;(;(A(A(C!D

-||0DDE "EAFF4L r   )r   r	   r   N)__name__
__module____qualname____firstlineno____doc__r   r   r   r#   r    r+   r3   __static_attributes____classdictcell____classdict__s   @r   r   r      s0     ;#

*) r   r   c                   l   a  ] tR t^8t o RtR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tRtV tR# )r   zA state of an NFA or DFA.c                d    \        4       V n        \        V n        R V n        ^ V n        R V n        R # r   )r   transitionsLOWEST_PRIORITYaction_priorityactionr   epsilon_closurer
   s   &r   r   Node.__init__;   s,     )?.#r   c                0    R V n         R V n        R V n        R # r   )rA   rD   rE   r
   s   &r   r   Node.destroyD   s    #r   c                <    V P                   P                  W4       R # r   )rA   add)r   eventr   s   &&&r   add_transitionNode.add_transitionI   s    U.r   c                *    V P                  RV4       R# )z5Add an epsilon-move from this state to another state. N)rL   r   s   &&r   link_toNode.link_toL   s    B&r   c                B    W P                   8  d   Wn        W n         R# R# )z{Make this an accepting state with the given action. If
there is already an action, choose the action with highest
priority.N)rC   rD   )r   rD   prioritys   &&&r   
set_actionNode.set_actionP   s      *** K#+  +r   c                    V P                   # r   rD   r
   s   &r   
get_actionNode.get_actionX   s    {{r   c                    V P                   # r   )rC   r
   s   &r   get_action_priorityNode.get_action_priority[   s    ###r   c                    V P                   R J# r   rW   r
   s   &r   is_acceptingNode.is_accepting^   s    {{$&&r   c                (    R V P                   ,          # )zState %dr   r
   s   &r   __str__Node.__str__a   s    DKK''r   c                    VP                  R V P                  ,          4       V P                  P                  V4       V P                  pV P
                  pVe   VP                  RW#3,          4       R# R# )   State %d:
Nz      %s [priority %d]
)r0   r   rA   r3   rD   rC   )r   r4   rD   rS   s   &&  r   r3   	Node.dumpd   sb    

#dkk12 	d#''JJ1V4FFG r   c                4    V P                   VP                   8  # r   ra   )r   others   &&r   __lt__Node.__lt__p   s    {{U\\))r   c                .    \        V 4      \        ,          # r   )idmaxintr
   s   &r   __hash__Node.__hash__s   s    $x&  r   )rD   rC   rE   r   rA   N)r6   r7   r8   r9   r:   r   r   rL   rP   rT   rX   r[   r^   rb   r3   ri   rn   r;   r<   r=   s   @r   r   r   8   sJ     #$$
/',$'(
H*! !r   r   c                      a  ] tR t^xt o RtR tR tRR ltR t]	3V 3R lR llt
R	 tR
 tR tR tV 3R lR ltV 3R lR ltV 3R lR ltRtV tR# )FastMachinezX
FastMachine is a deterministic machine represented in a way that
allows fast scanning.
c           
     R    / V n         . V n        ^V n        RRRRRRRRRR/V n        R# )r   rO   Nboleoleofelse)r   r   next_numbernew_state_templater
   s   &r   r   FastMachine.__init__}   s8     eT5$tVT#
r   c                L    V P                    F  pVP                  4        K  	  R # r   )r   clearr   s   & r   r   FastMachine.__del__   s    [[EKKM !r   Nc                    V P                   pV^,           V n         V P                  P                  4       pW#R&   WR&   V P                  P	                  V4       V# )r   r   rD   )rw   rx   copyr   r   )r   rD   r   results   &&  r   r   FastMachine.new_state   sT    $($4$4!A:((--/!x!x6"r   c                "    W P                   V&   R # r   r&   r!   s   &&&r   r    FastMachine.make_initial_state   r(   r   c                :   < V ^8  d   QhRS[ RS[P                  /# )   r   rm   )dictcythonint)formatr>   s   "r   __annotate__FastMachine.__annotate__   s     % %T %VZZ %r   c                    \        V4      \        J d;   Vw  rVWT) 8X  d   W1R &   R# Wd8w  d"   \        WV4       F  pW1\        V4      &   K  	  R# R# W1V&   R# )rv   N)typetuplerangechr)r   r   rK   r   rm   code0code1codes   &&&&&   r   add_transitionsFastMachine.add_transitions   sT    
 ;% LE )f!%/D'0#d)$ 0 ! %%Lr   c                (    V P                   V,          # r   r&   r*   s   &&r   r+   FastMachine.get_initial_state   r-   r   c                >   VP                  R 4       VP                  R4       \        V P                  P                  4       4       F/  w  r#VP                  R\	        V4      : RVR,          : R24       K1  	  V P
                   F  pV P                  W14       K  	  R# )zPlex.FastMachine:
r/   z      z: r   
N)r0   r1   r   r2   reprr   
dump_state)r   r4   r"   r   s   &&  r   r3   FastMachine.dump   sq    

()

)*!$"5"5";";"=>KDJJ4:uXGH ?[[EOOE( !r   c                    VP                  R VR,          ,          4       V P                  W4       VR,          pVe   VP                  RV,          4       R# R# )re   r   rD   Nz	      %s
)r0   dump_transitions)r   r   r4   rD   s   &&& r   r   FastMachine.dump_state   sK    

#eHo56e*xJJ|f,- r   c                   / p/ pVP                  4        Fk  w  rV\        V4      ^8X  dA   VP                  \        V4      4      pVf   . pWs\        V4      &   VP	                  V4       KU  \        V4      ^8:  g   Kg  WdV&   Km  	  / pV P
                   F<  pVP                  \        V4      4      p	V	'       g   K'  V P                  V	4      p
WV
&   K>  	  \        V4       F<  p
V P                  V
4      pW,          pVP                  RWR,          3,          4       K>  	  R F>  pVP                  V4      pV'       g   K  VP                  RWR,          3,          4       K@  	  R# )r   Nz      %s --> State %d
r   )rs   rt   ru   rv   )
r2   lengetrl   r   r   chars_to_rangesr1   ranges_to_stringr0   )r   r   r4   chars_leading_to_statespecial_to_statecr   charsranges_to_state	char_listrangeskeys   &&&         r   r   FastMachine.dump_transitions   s5   !#kkmFQ1v{.222a59=E492a51QQ1&'# $ [[E.222e9=Iy--i8*/'	 !
 _-F''/C#+EJJ0Cx3IIJ . 1C$((-Eu

48_7MMN 1r   c                &   < V ^8  d   QhRS[ RS[/# )r   r   return)listr   )r   r>   s   "r   r   r      s       % r   c                V   VP                  4        ^ p\        V4      p. pW#8  d{   \        W,          4      pTpV^,          pW#8  d2   \        W,          4      V^,           8X  d   V^,          pV^,          pK7  VP                  \	        V4      \	        V4      34       K  \        V4      # )    )sortr   ordr   r   r   )r   r   ir   r   c1c2s   &&     r   r   FastMachine.chars_to_ranges   s      !"9~eY\"BBFA%C	-a7QaMM3r7CG,-V}r   c                    < V ^8  d   QhRS[ /# )r   r   )str)r   r>   s   "r   r   r      s     ? ?c ?r   c                L    R P                  \        V P                  V4      4      # ),)joinmaprange_to_string)r   
range_lists   &&r   r   FastMachine.ranges_to_string   s    xxD00*=>>r   c                    < V ^8  d   QhRS[ /# )r   range_tuple)r   )r   r>   s   "r   r   r      s     % %5 %r   c                >    Vw  r#W#8X  d   \        V4      # V: R V: 2# )z..)r   )r   r   r   r   s   &&  r   r   FastMachine.range_to_string   s(    88OV2bV$$r   )r   rx   rw   r   r   )r6   r7   r8   r9   r:   r   r   r   r    rm   r   r+   r3   r   r   r   r   r   r;   r<   r=   s   @r   rq   rq   x   sb     
* SY % %)).O6 $? ?% %r   rq   i)	r:   r   Transitionsr   rm   rB   r   r   rq    r   r   <module>r      s@     &	'& &R=! =!@v% v%r   