#NEWLINE# def __init__( self , index , unexpected = None , expected = None , message = None ) : #NEWLINE# #INDENT# if ( unexpected and expected ) : #NEWLINE# #INDENT# msg = ( "Unexpected token: '%s'.  Expected token '%s'." % ( unexpected , expected ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if unexpected : #NEWLINE# #INDENT# msg = ( "Unexpected token: '%s'." % unexpected ) #NEWLINE# if message : #NEWLINE# #INDENT# msg += ( '  ' + message ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# msg = ( "Expected token '%s'." % expected ) #NEWLINE# #UNINDENT# #UNINDENT# LogicalExpressionException . __init__ ( self , index , msg )