#NEWLINE# def __init__( self , grammar ) : #NEWLINE# #INDENT# stack = [ ] #NEWLINE# self . copy0 = grammar . copy0 #NEWLINE# for c in GrammarCracker . _traverse_grammar_postfix ( grammar ) : #NEWLINE# #INDENT# if ( c is GrammarCracker . _concat ) : #NEWLINE# #INDENT# ( start2 , out2 ) = stack . pop ( ) #NEWLINE# ( start1 , out1 ) = stack . pop ( ) #NEWLINE# for l in out1 : #NEWLINE# #INDENT# l ( start2 ) #NEWLINE# #UNINDENT# stack . append ( [ start1 , out2 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( c , _bstate ) : #NEWLINE# #INDENT# ( start2 , out2 ) = stack . pop ( ) #NEWLINE# ( start1 , out1 ) = stack . pop ( ) #NEWLINE# s = _bstate ( c . name , start1 , start2 ) #NEWLINE# stack . append ( [ s , ( out1 + out2 ) ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( c , tuple ) : #NEWLINE# #INDENT# ( a , b , name ) = c #NEWLINE# ( start , out ) = stack . pop ( ) #NEWLINE# s = _rstate ( name , a , b , start ) #NEWLINE# for l in out : #NEWLINE# #INDENT# l ( s ) #NEWLINE# #UNINDENT# stack . append ( [ s , [ s . set_out ] ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# s = _cstate ( c ) #NEWLINE# stack . append ( [ s , [ s . set_out ] ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# ( self . _start , out ) = stack . pop ( ) #NEWLINE# assert ( not stack ) #NEWLINE# for l in out : #NEWLINE# #INDENT# l ( GrammarCracker . _matchstate )