schrodinger.application.desmond.antlr3.tokens module¶
ANTLR3 runtime package
-
class
schrodinger.application.desmond.antlr3.tokens.
Token
[source]¶ Bases:
object
@brief Abstract token baseclass.
-
getText
()[source]¶ @brief Get the text of the token.
Using setter/getter methods is deprecated. Use o.text instead.
-
setText
(text)[source]¶ @brief Set the text of the token.
Using setter/getter methods is deprecated. Use o.text instead.
-
getType
()[source]¶ @brief Get the type of the token.
Using setter/getter methods is deprecated. Use o.type instead.
-
setType
(ttype)[source]¶ @brief Get the type of the token.
Using setter/getter methods is deprecated. Use o.type instead.
-
getLine
()[source]¶ @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)[source]¶ @brief Set the line number on which this token was matched
Using setter/getter methods is deprecated. Use o.line instead.
-
getCharPositionInLine
()[source]¶ @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)[source]¶ @brief Set the column of the tokens first character,
Using setter/getter methods is deprecated. Use o.charPositionInLine instead.
-
getChannel
()[source]¶ @brief Get the channel of the token
Using setter/getter methods is deprecated. Use o.channel instead.
-
setChannel
(channel)[source]¶ @brief Set the channel of the token
Using setter/getter methods is deprecated. Use o.channel instead.
-
getTokenIndex
()[source]¶ @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)[source]¶ @brief Set the index in the input stream.
Using setter/getter methods is deprecated. Use o.index instead.
-
-
class
schrodinger.application.desmond.antlr3.tokens.
CommonToken
(type=None, channel=0, text=None, input=None, start=None, stop=None, oldToken=None)[source]¶ 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)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
getText
()[source]¶ @brief Get the text of the token.
Using setter/getter methods is deprecated. Use o.text instead.
-
setText
(text)[source]¶ 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.
-
property
text
¶
-
getType
()[source]¶ @brief Get the type of the token.
Using setter/getter methods is deprecated. Use o.type instead.
-
setType
(ttype)[source]¶ @brief Get the type of the token.
Using setter/getter methods is deprecated. Use o.type instead.
-
getLine
()[source]¶ @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)[source]¶ @brief Set the line number on which this token was matched
Using setter/getter methods is deprecated. Use o.line instead.
-
getCharPositionInLine
()[source]¶ @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)[source]¶ @brief Set the column of the tokens first character,
Using setter/getter methods is deprecated. Use o.charPositionInLine instead.
-
getChannel
()[source]¶ @brief Get the channel of the token
Using setter/getter methods is deprecated. Use o.channel instead.
-
setChannel
(channel)[source]¶ @brief Set the channel of the token
Using setter/getter methods is deprecated. Use o.channel instead.
-
getTokenIndex
()[source]¶ @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)[source]¶ @brief Set the index in the input stream.
Using setter/getter methods is deprecated. Use o.index instead.
-
-
class
schrodinger.application.desmond.antlr3.tokens.
ClassicToken
(type=None, text=None, channel=0, oldToken=None)[source]¶ 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)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
getText
()[source]¶ @brief Get the text of the token.
Using setter/getter methods is deprecated. Use o.text instead.
-
setText
(text)[source]¶ @brief Set the text of the token.
Using setter/getter methods is deprecated. Use o.text instead.
-
getType
()[source]¶ @brief Get the type of the token.
Using setter/getter methods is deprecated. Use o.type instead.
-
setType
(ttype)[source]¶ @brief Get the type of the token.
Using setter/getter methods is deprecated. Use o.type instead.
-
getLine
()[source]¶ @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)[source]¶ @brief Set the line number on which this token was matched
Using setter/getter methods is deprecated. Use o.line instead.
-
getCharPositionInLine
()[source]¶ @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)[source]¶ @brief Set the column of the tokens first character,
Using setter/getter methods is deprecated. Use o.charPositionInLine instead.
-
getChannel
()[source]¶ @brief Get the channel of the token
Using setter/getter methods is deprecated. Use o.channel instead.
-
setChannel
(channel)[source]¶ @brief Set the channel of the token
Using setter/getter methods is deprecated. Use o.channel instead.
-
getTokenIndex
()[source]¶ @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)[source]¶ @brief Set the index in the input stream.
Using setter/getter methods is deprecated. Use o.index instead.
-
getInputStream
()[source]¶ @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.
-