<s> """<STR_LIT>""" <EOL> from google . appengine . _internal . antlr3 . constants import INVALID_TOKEN_TYPE <EOL> class BacktrackingFailed ( Exception ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class RecognitionException ( Exception ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , input = None ) : <EOL> Exception . __init__ ( self ) <EOL> self . input = None <EOL> self . index = None <EOL> self . token = None <EOL> self . node = None <EOL> self . c = None <EOL> self . line = None <EOL> self . charPositionInLine = None <EOL> self . approximateLineInfo = False <EOL> if input is not None : <EOL> self . input = input <EOL> self . index = input . index ( ) <EOL> from google . appengine . _internal . antlr3 . streams import TokenStream , CharStream <EOL> from google . appengine . _internal . antlr3 . tree import TreeNodeStream <EOL> if isinstance ( self . input , TokenStream ) : <EOL> self . token = self . input . LT ( <NUM_LIT:1> ) <EOL> self . line = self . token . line <EOL> self . charPositionInLine = self . token . charPositionInLine <EOL> if isinstance ( self . input , TreeNodeStream ) : <EOL> self . extractInformationFromTreeNodeStream ( self . input ) <EOL> else : <EOL> if isinstance ( self . input , CharStream ) : <EOL> self . c = self . input . LT ( <NUM_LIT:1> ) <EOL> self . line = self . input . line <EOL> self . charPositionInLine = self . input . charPositionInLine <EOL> else : <EOL> self . c = self . input . LA ( <NUM_LIT:1> ) <EOL> def extractInformationFromTreeNodeStream ( self , nodes ) : <EOL> from google . appengine . _internal . antlr3 . tree import Tree , CommonTree <EOL> from google . appengine . _internal . antlr3 . tokens import CommonToken <EOL> self . node = nodes . LT ( <NUM_LIT:1> ) <EOL> adaptor = nodes . adaptor <EOL> payload = adaptor . getToken ( self . node ) <EOL> if payload is not None : <EOL> self . token = payload <EOL> if payload . line <= <NUM_LIT:0> : <EOL> i = - <NUM_LIT:1> <EOL> priorNode = nodes . LT ( i ) <EOL> while priorNode is not None : <EOL> priorPayload = adaptor . getToken ( priorNode ) <EOL> if priorPayload is not None and priorPayload . line > <NUM_LIT:0> : <EOL> self . line = priorPayload . line <EOL> self . charPositionInLine = priorPayload . charPositionInLine <EOL> self . approximateLineInfo = True <EOL> break <EOL> i -= <NUM_LIT:1> <EOL> priorNode = nodes . LT ( i ) <EOL> else : <EOL> self . line = payload . line <EOL> self . charPositionInLine = payload . charPositionInLine <EOL> elif isinstance ( self . node , Tree ) : <EOL> self . line = self . node . line <EOL> self . charPositionInLine = self . node . charPositionInLine <EOL> if isinstance ( self . node , CommonTree ) : <EOL> self . token = self . node . token <EOL> else : <EOL> type = adaptor . getType ( self . node ) <EOL> text = adaptor . getText ( self . node ) <EOL> self . token = CommonToken ( type = type , text = text ) <EOL> def getUnexpectedType ( self ) : <EOL> """<STR_LIT>""" <EOL> from google . appengine . _internal . antlr3 . streams import TokenStream <EOL> from google . appengine . _internal . antlr3 . tree import TreeNodeStream <EOL> if isinstance ( self . input , TokenStream ) : <EOL> return self . token . type <EOL> elif isinstance ( self . input , TreeNodeStream ) : <EOL> adaptor = self . input . treeAdaptor <EOL> return adaptor . getType ( self . node ) <EOL> else : <EOL> return self . c <EOL> unexpectedType = property ( getUnexpectedType ) <EOL> class MismatchedTokenException ( RecognitionException ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , expecting , input ) : <EOL> RecognitionException . __init__ ( self , input ) <EOL> self . expecting = expecting <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" % ( <EOL> self . getUnexpectedType ( ) , self . expecting <EOL> ) <EOL> __repr__ = __str__ <EOL> class UnwantedTokenException ( MismatchedTokenException ) : <EOL> """<STR_LIT>""" <EOL> def getUnexpectedToken ( self ) : <EOL> return self . token <EOL> def __str__ ( self ) : <EOL> exp = "<STR_LIT>" % self . expecting <EOL> if self . expecting == INVALID_TOKEN_TYPE : <EOL> exp = "<STR_LIT>" <EOL> if self . token is None : <EOL> return "<STR_LIT>" % ( None , exp ) <EOL> return "<STR_LIT>" % ( self . token . text , exp ) <EOL> __repr__ = __str__ <EOL> class MissingTokenException ( MismatchedTokenException ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , expecting , input , inserted ) : <EOL> MismatchedTokenException . __init__ ( self , expecting , input ) <EOL> self . inserted = inserted <EOL> def getMissingType ( self ) : <EOL> return self . expecting <EOL> def __str__ ( self ) : <EOL> if self . inserted is not None and self . token is not None : <EOL> return "<STR_LIT>" % ( <EOL> self . inserted , self . token . text ) <EOL> if self . token is not None : <EOL> return "<STR_LIT>" % self . token . text <EOL> return "<STR_LIT>" <EOL> __repr__ = __str__ <EOL> class MismatchedRangeException ( RecognitionException ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , a , b , input ) : <EOL> RecognitionException . __init__ ( self , input ) <EOL> self . a = a <EOL> self . b = b <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" % ( <EOL> self . getUnexpectedType ( ) , self . a , self . b <EOL> ) <EOL> __repr__ = __str__ <EOL> class MismatchedSetException ( RecognitionException ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , expecting , input ) : <EOL> RecognitionException . __init__ ( self , input ) <EOL> self . expecting = expecting <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" % ( <EOL> self . getUnexpectedType ( ) , self . expecting <EOL> ) <EOL> __repr__ = __str__ <EOL> class MismatchedNotSetException ( MismatchedSetException ) : <EOL> """<STR_LIT>""" <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" % ( <EOL> self . getUnexpectedType ( ) , self . expecting <EOL> ) <EOL> __repr__ = __str__ <EOL> class NoViableAltException ( RecognitionException ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( <EOL> self , grammarDecisionDescription , decisionNumber , stateNumber , input <EOL> ) : <EOL> RecognitionException . __init__ ( self , input ) <EOL> self . grammarDecisionDescription = grammarDecisionDescription <EOL> self . decisionNumber = decisionNumber <EOL> self . stateNumber = stateNumber <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" % ( <EOL> self . unexpectedType , self . grammarDecisionDescription <EOL> ) <EOL> __repr__ = __str__ <EOL> class EarlyExitException ( RecognitionException ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , decisionNumber , input ) : <EOL> RecognitionException . __init__ ( self , input ) <EOL> self . decisionNumber = decisionNumber <EOL> class FailedPredicateException ( RecognitionException ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , input , ruleName , predicateText ) : <EOL> RecognitionException . __init__ ( self , input ) <EOL> self . ruleName = ruleName <EOL> self . predicateText = predicateText <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" + self . ruleName + "<STR_LIT>" + self . predicateText + "<STR_LIT>" <EOL> __repr__ = __str__ <EOL> class MismatchedTreeNodeException ( RecognitionException ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , expecting , input ) : <EOL> RecognitionException . __init__ ( self , input ) <EOL> self . expecting = expecting <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" % ( <EOL> self . getUnexpectedType ( ) , self . expecting <EOL> ) <EOL> __repr__ = __str__ </s>
