schrodinger.application.desmond.antlr3.tokens module¶
ANTLR3 runtime package
-
class
schrodinger.application.desmond.antlr3.tokens.
Token
¶ Bases:
object
@brief Abstract token baseclass.
-
getText
()¶ @brief Get the text of the token.
Using setter/getter methods is deprecated. Use o.text instead.
-
setText
(text)¶ @brief Set the text of the token.
Using setter/getter methods is deprecated. Use o.text instead.
-
getType
()¶ @brief Get the type of the token.
Using setter/getter methods is deprecated. Use o.type instead.
-
setType
(ttype)¶ @brief Get the type of the token.
Using setter/getter methods is deprecated. Use o.type instead.
-
getLine
()¶ @brief Get the line number on which this token was matched
Lines are numbered 1..n
Using setter/getter methods is deprecated. Use o.line instead.
-
setLine
(line)¶ @brief Set the line number on which this token was matched
Using setter/getter methods is deprecated. Use o.line instead.
-
getCharPositionInLine
()¶ @brief Get the column of the tokens first character,
Columns are numbered 0..n-1
Using setter/getter methods is deprecated. Use o.charPositionInLine instead.
-
setCharPositionInLine
(pos)¶ @brief Set the column of the tokens first character,
Using setter/getter methods is deprecated. Use o.charPositionInLine instead.
-
getChannel
()¶ @brief Get the channel of the token
Using setter/getter methods is deprecated. Use o.channel instead.
-
setChannel
(channel)¶ @brief Set the channel of the token
Using setter/getter methods is deprecated. Use o.channel instead.
-
getTokenIndex
()¶ @brief Get the index in the input stream.
An index from 0..n-1 of the token object in the input stream. This must be valid in order to use the ANTLRWorks debugger.
Using setter/getter methods is deprecated. Use o.index instead.
-
setTokenIndex
(index)¶ @brief Set the index in the input stream.
Using setter/getter methods is deprecated. Use o.index instead.
-
getInputStream
()¶ @brief From what character stream was this token created.
You don’t have to implement but it’s nice to know where a Token comes from if you have include files etc… on the input.
-
setInputStream
(input)¶ @brief From what character stream was this token created.
You don’t have to implement but it’s nice to know where a Token comes from if you have include files etc… on the input.
-
__class__
¶ alias of
builtins.type
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.application.desmond.antlr3.tokens', '__doc__': '@brief Abstract token baseclass.', 'getText': <function Token.getText>, 'setText': <function Token.setText>, 'getType': <function Token.getType>, 'setType': <function Token.setType>, 'getLine': <function Token.getLine>, 'setLine': <function Token.setLine>, 'getCharPositionInLine': <function Token.getCharPositionInLine>, 'setCharPositionInLine': <function Token.setCharPositionInLine>, 'getChannel': <function Token.getChannel>, 'setChannel': <function Token.setChannel>, 'getTokenIndex': <function Token.getTokenIndex>, 'setTokenIndex': <function Token.setTokenIndex>, 'getInputStream': <function Token.getInputStream>, 'setInputStream': <function Token.setInputStream>, '__dict__': <attribute '__dict__' of 'Token' objects>, '__weakref__': <attribute '__weakref__' of 'Token' objects>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.application.desmond.antlr3.tokens'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
class
schrodinger.application.desmond.antlr3.tokens.
CommonToken
(type=None, channel=0, text=None, input=None, start=None, stop=None, oldToken=None)¶ Bases:
schrodinger.application.desmond.antlr3.tokens.Token
@brief Basic token implementation.
This implementation does not copy the text from the input stream upon creation, but keeps start/stop pointers into the stream to avoid unnecessary copy operations.
-
__init__
(type=None, channel=0, text=None, input=None, start=None, stop=None, oldToken=None)¶ Initialize self. See help(type(self)) for accurate signature.
-
getText
()¶ @brief Get the text of the token.
Using setter/getter methods is deprecated. Use o.text instead.
-
setText
(text)¶ Override the text for this token. getText() will return this text rather than pulling from the buffer. Note that this does not mean that start/stop indexes are not valid. It means that that input was converted to a new string in the token object.
-
text
¶
-
getType
()¶ @brief Get the type of the token.
Using setter/getter methods is deprecated. Use o.type instead.
-
setType
(ttype)¶ @brief Get the type of the token.
Using setter/getter methods is deprecated. Use o.type instead.
-
getLine
()¶ @brief Get the line number on which this token was matched
Lines are numbered 1..n
Using setter/getter methods is deprecated. Use o.line instead.
-
setLine
(line)¶ @brief Set the line number on which this token was matched
Using setter/getter methods is deprecated. Use o.line instead.
-
getCharPositionInLine
()¶ @brief Get the column of the tokens first character,
Columns are numbered 0..n-1
Using setter/getter methods is deprecated. Use o.charPositionInLine instead.
-
setCharPositionInLine
(pos)¶ @brief Set the column of the tokens first character,
Using setter/getter methods is deprecated. Use o.charPositionInLine instead.
-
getChannel
()¶ @brief Get the channel of the token
Using setter/getter methods is deprecated. Use o.channel instead.
-
setChannel
(channel)¶ @brief Set the channel of the token
Using setter/getter methods is deprecated. Use o.channel instead.
-
getTokenIndex
()¶ @brief Get the index in the input stream.
An index from 0..n-1 of the token object in the input stream. This must be valid in order to use the ANTLRWorks debugger.
Using setter/getter methods is deprecated. Use o.index instead.
-
setTokenIndex
(index)¶ @brief Set the index in the input stream.
Using setter/getter methods is deprecated. Use o.index instead.
-
getInputStream
()¶ @brief From what character stream was this token created.
You don’t have to implement but it’s nice to know where a Token comes from if you have include files etc… on the input.
-
setInputStream
(input)¶ @brief From what character stream was this token created.
You don’t have to implement but it’s nice to know where a Token comes from if you have include files etc… on the input.
-
__str__
()¶ Return str(self).
-
__class__
¶ alias of
builtins.type
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.application.desmond.antlr3.tokens', '__doc__': '@brief Basic token implementation.\n\n This implementation does not copy the text from the input stream upon\n creation, but keeps start/stop pointers into the stream to avoid\n unnecessary copy operations.\n\n ', '__init__': <function CommonToken.__init__>, 'getText': <function CommonToken.getText>, 'setText': <function CommonToken.setText>, 'text': <property object>, 'getType': <function CommonToken.getType>, 'setType': <function CommonToken.setType>, 'getLine': <function CommonToken.getLine>, 'setLine': <function CommonToken.setLine>, 'getCharPositionInLine': <function CommonToken.getCharPositionInLine>, 'setCharPositionInLine': <function CommonToken.setCharPositionInLine>, 'getChannel': <function CommonToken.getChannel>, 'setChannel': <function CommonToken.setChannel>, 'getTokenIndex': <function CommonToken.getTokenIndex>, 'setTokenIndex': <function CommonToken.setTokenIndex>, 'getInputStream': <function CommonToken.getInputStream>, 'setInputStream': <function CommonToken.setInputStream>, '__str__': <function CommonToken.__str__>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.application.desmond.antlr3.tokens'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
class
schrodinger.application.desmond.antlr3.tokens.
ClassicToken
(type=None, text=None, channel=0, oldToken=None)¶ Bases:
schrodinger.application.desmond.antlr3.tokens.Token
@brief Alternative token implementation.
A Token object like we’d use in ANTLR 2.x; has an actual string created and associated with this object. These objects are needed for imaginary tree nodes that have payload objects. We need to create a Token object that has a string; the tree node will point at this token. CommonToken has indexes into a char stream and hence cannot be used to introduce new strings.
-
__init__
(type=None, text=None, channel=0, oldToken=None)¶ Initialize self. See help(type(self)) for accurate signature.
-
getText
()¶ @brief Get the text of the token.
Using setter/getter methods is deprecated. Use o.text instead.
-
setText
(text)¶ @brief Set the text of the token.
Using setter/getter methods is deprecated. Use o.text instead.
-
getType
()¶ @brief Get the type of the token.
Using setter/getter methods is deprecated. Use o.type instead.
-
setType
(ttype)¶ @brief Get the type of the token.
Using setter/getter methods is deprecated. Use o.type instead.
-
getLine
()¶ @brief Get the line number on which this token was matched
Lines are numbered 1..n
Using setter/getter methods is deprecated. Use o.line instead.
-
setLine
(line)¶ @brief Set the line number on which this token was matched
Using setter/getter methods is deprecated. Use o.line instead.
-
__class__
¶ alias of
builtins.type
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.application.desmond.antlr3.tokens', '__doc__': "@brief Alternative token implementation.\n\n A Token object like we'd use in ANTLR 2.x; has an actual string created\n and associated with this object. These objects are needed for imaginary\n tree nodes that have payload objects. We need to create a Token object\n that has a string; the tree node will point at this token. CommonToken\n has indexes into a char stream and hence cannot be used to introduce\n new strings.\n ", '__init__': <function ClassicToken.__init__>, 'getText': <function ClassicToken.getText>, 'setText': <function ClassicToken.setText>, 'getType': <function ClassicToken.getType>, 'setType': <function ClassicToken.setType>, 'getLine': <function ClassicToken.getLine>, 'setLine': <function ClassicToken.setLine>, 'getCharPositionInLine': <function ClassicToken.getCharPositionInLine>, 'setCharPositionInLine': <function ClassicToken.setCharPositionInLine>, 'getChannel': <function ClassicToken.getChannel>, 'setChannel': <function ClassicToken.setChannel>, 'getTokenIndex': <function ClassicToken.getTokenIndex>, 'setTokenIndex': <function ClassicToken.setTokenIndex>, 'getInputStream': <function ClassicToken.getInputStream>, 'setInputStream': <function ClassicToken.setInputStream>, 'toString': <function ClassicToken.toString>, '__str__': <function ClassicToken.toString>, '__repr__': <function ClassicToken.toString>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.application.desmond.antlr3.tokens'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
getCharPositionInLine
()¶ @brief Get the column of the tokens first character,
Columns are numbered 0..n-1
Using setter/getter methods is deprecated. Use o.charPositionInLine instead.
-
setCharPositionInLine
(pos)¶ @brief Set the column of the tokens first character,
Using setter/getter methods is deprecated. Use o.charPositionInLine instead.
-
getChannel
()¶ @brief Get the channel of the token
Using setter/getter methods is deprecated. Use o.channel instead.
-
setChannel
(channel)¶ @brief Set the channel of the token
Using setter/getter methods is deprecated. Use o.channel instead.
-
getTokenIndex
()¶ @brief Get the index in the input stream.
An index from 0..n-1 of the token object in the input stream. This must be valid in order to use the ANTLRWorks debugger.
Using setter/getter methods is deprecated. Use o.index instead.
-
setTokenIndex
(index)¶ @brief Set the index in the input stream.
Using setter/getter methods is deprecated. Use o.index instead.
-
getInputStream
()¶ @brief From what character stream was this token created.
You don’t have to implement but it’s nice to know where a Token comes from if you have include files etc… on the input.
-
setInputStream
(input)¶ @brief From what character stream was this token created.
You don’t have to implement but it’s nice to know where a Token comes from if you have include files etc… on the input.
-
toString
()¶
-
__str__
()¶
-
__repr__
()¶
-