<s> """<STR_LIT>""" <EOL> from google . appengine . _internal . antlr3 . constants import EOF , DEFAULT_CHANNEL , INVALID_TOKEN_TYPE <EOL> class Token ( object ) : <EOL> """<STR_LIT>""" <EOL> def getText ( self ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def setText ( self , text ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def getType ( self ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def setType ( self , ttype ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def getLine ( self ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def setLine ( self , line ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def getCharPositionInLine ( self ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def setCharPositionInLine ( self , pos ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def getChannel ( self ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def setChannel ( self , channel ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def getTokenIndex ( self ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def setTokenIndex ( self , index ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def getInputStream ( self ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def setInputStream ( self , input ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> class CommonToken ( Token ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , type = None , channel = DEFAULT_CHANNEL , text = None , <EOL> input = None , start = None , stop = None , oldToken = None ) : <EOL> Token . __init__ ( self ) <EOL> if oldToken is not None : <EOL> self . type = oldToken . type <EOL> self . line = oldToken . line <EOL> self . charPositionInLine = oldToken . charPositionInLine <EOL> self . channel = oldToken . channel <EOL> self . index = oldToken . index <EOL> self . _text = oldToken . _text <EOL> if isinstance ( oldToken , CommonToken ) : <EOL> self . input = oldToken . input <EOL> self . start = oldToken . start <EOL> self . stop = oldToken . stop <EOL> else : <EOL> self . type = type <EOL> self . input = input <EOL> self . charPositionInLine = - <NUM_LIT:1> <EOL> self . line = <NUM_LIT:0> <EOL> self . channel = channel <EOL> self . index = - <NUM_LIT:1> <EOL> self . _text = text <EOL> self . start = start <EOL> self . stop = stop <EOL> def getText ( self ) : <EOL> if self . _text is not None : <EOL> return self . _text <EOL> if self . input is None : <EOL> return None <EOL> return self . input . substring ( self . start , self . stop ) <EOL> def setText ( self , text ) : <EOL> """<STR_LIT>""" <EOL> self . _text = text <EOL> text = property ( getText , setText ) <EOL> def getType ( self ) : <EOL> return self . type <EOL> def setType ( self , ttype ) : <EOL> self . type = ttype <EOL> def getLine ( self ) : <EOL> return self . line <EOL> def setLine ( self , line ) : <EOL> self . line = line <EOL> def getCharPositionInLine ( self ) : <EOL> return self . charPositionInLine <EOL> def setCharPositionInLine ( self , pos ) : <EOL> self . charPositionInLine = pos <EOL> def getChannel ( self ) : <EOL> return self . channel <EOL> def setChannel ( self , channel ) : <EOL> self . channel = channel <EOL> def getTokenIndex ( self ) : <EOL> return self . index <EOL> def setTokenIndex ( self , index ) : <EOL> self . index = index <EOL> def getInputStream ( self ) : <EOL> return self . input <EOL> def setInputStream ( self , input ) : <EOL> self . input = input <EOL> def __str__ ( self ) : <EOL> if self . type == EOF : <EOL> return "<STR_LIT>" <EOL> channelStr = "<STR_LIT>" <EOL> if self . channel > <NUM_LIT:0> : <EOL> channelStr = "<STR_LIT>" + str ( self . channel ) <EOL> txt = self . text <EOL> if txt is not None : <EOL> txt = txt . replace ( "<STR_LIT:\n>" , "<STR_LIT>" ) <EOL> txt = txt . replace ( "<STR_LIT:\r>" , "<STR_LIT>" ) <EOL> txt = txt . replace ( "<STR_LIT:\t>" , "<STR_LIT>" ) <EOL> else : <EOL> txt = "<STR_LIT>" <EOL> return "<STR_LIT>" % ( <EOL> self . index , <EOL> self . start , self . stop , <EOL> txt , <EOL> self . type , channelStr , <EOL> self . line , self . charPositionInLine <EOL> ) <EOL> class ClassicToken ( Token ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , type = None , text = None , channel = DEFAULT_CHANNEL , <EOL> oldToken = None <EOL> ) : <EOL> Token . __init__ ( self ) <EOL> if oldToken is not None : <EOL> self . text = oldToken . text <EOL> self . type = oldToken . type <EOL> self . line = oldToken . line <EOL> self . charPositionInLine = oldToken . charPositionInLine <EOL> self . channel = oldToken . channel <EOL> self . text = text <EOL> self . type = type <EOL> self . line = None <EOL> self . charPositionInLine = None <EOL> self . channel = channel <EOL> self . index = None <EOL> def getText ( self ) : <EOL> return self . text <EOL> def setText ( self , text ) : <EOL> self . text = text <EOL> def getType ( self ) : <EOL> return self . type <EOL> def setType ( self , ttype ) : <EOL> self . type = ttype <EOL> def getLine ( self ) : <EOL> return self . line <EOL> def setLine ( self , line ) : <EOL> self . line = line <EOL> def getCharPositionInLine ( self ) : <EOL> return self . charPositionInLine <EOL> def setCharPositionInLine ( self , pos ) : <EOL> self . charPositionInLine = pos <EOL> def getChannel ( self ) : <EOL> return self . channel <EOL> def setChannel ( self , channel ) : <EOL> self . channel = channel <EOL> def getTokenIndex ( self ) : <EOL> return self . index <EOL> def setTokenIndex ( self , index ) : <EOL> self . index = index <EOL> def getInputStream ( self ) : <EOL> return None <EOL> def setInputStream ( self , input ) : <EOL> pass <EOL> def toString ( self ) : <EOL> channelStr = "<STR_LIT>" <EOL> if self . channel > <NUM_LIT:0> : <EOL> channelStr = "<STR_LIT>" + str ( self . channel ) <EOL> txt = self . text <EOL> if txt is None : <EOL> txt = "<STR_LIT>" <EOL> return "<STR_LIT>" % ( self . index , <EOL> txt , <EOL> self . type , <EOL> channelStr , <EOL> self . line , <EOL> self . charPositionInLine <EOL> ) <EOL> __str__ = toString <EOL> __repr__ = toString <EOL> EOF_TOKEN = CommonToken ( type = EOF ) <EOL> INVALID_TOKEN = CommonToken ( type = INVALID_TOKEN_TYPE ) <EOL> SKIP_TOKEN = CommonToken ( type = INVALID_TOKEN_TYPE ) </s>
