Token streams TokenStream +- CommonTokenStream
More...
|
| tokenSource |
|
| tokens |
|
| p |
|
| channel |
|
| lastMarker |
|
Token streams TokenStream +- CommonTokenStream
@brief The most common stream of tokens
The most common stream of tokens is one where every token is buffered up
and tokens are prefiltered for a certain channel (the parser will only
see these tokens and cannot change the filter channel number during the
parse).
def google.appengine._internal.antlr3.streams.CommonTokenStream.__init__ |
( |
|
self, |
|
|
|
tokenSource = None , |
|
|
|
channel = DEFAULT_CHANNEL |
|
) |
| |
@param tokenSource A TokenSource instance (usually a Lexer) to pull
the tokens from.
@param channel Skip tokens on any channel but this one; this is how we
skip whitespace...
def google.appengine._internal.antlr3.streams.CommonTokenStream.consume |
( |
|
self | ) |
|
Move the input pointer to the next incoming token. The stream
must become active with LT(1) available. consume() simply
moves the input pointer so that LT(1) points at the next
input symbol. Consume at least one token.
Walk past any token not on the channel the parser is listening to.
def google.appengine._internal.antlr3.streams.CommonTokenStream.fillBuffer |
( |
|
self | ) |
|
Load all tokens from the token source and put in tokens.
This is done upon first LT request because you might want to
set some token type / channel overrides before filling buffer.
def google.appengine._internal.antlr3.streams.CommonTokenStream.get |
( |
|
self, |
|
|
|
i |
|
) |
| |
Return absolute token i; ignore which channel the tokens are on;
that is, count all tokens not just on-channel tokens.
def google.appengine._internal.antlr3.streams.CommonTokenStream.getTokens |
( |
|
self, |
|
|
|
start = None , |
|
|
|
stop = None , |
|
|
|
types = None |
|
) |
| |
Given a start and stop index, return a list of all tokens in
the token type set. Return None if no tokens were found. This
method looks at both on and off channel tokens.
def google.appengine._internal.antlr3.streams.CommonTokenStream.LB |
( |
|
self, |
|
|
|
k |
|
) |
| |
Look backwards k tokens on-channel tokens
def google.appengine._internal.antlr3.streams.CommonTokenStream.LT |
( |
|
self, |
|
|
|
k |
|
) |
| |
Get the ith token from the current position 1..n where k=1 is the
first symbol of lookahead.
def google.appengine._internal.antlr3.streams.CommonTokenStream.setTokenSource |
( |
|
self, |
|
|
|
tokenSource |
|
) |
| |
Reset this token stream by setting its token source.
def google.appengine._internal.antlr3.streams.CommonTokenStream.setTokenTypeChannel |
( |
|
self, |
|
|
|
ttype, |
|
|
|
channel |
|
) |
| |
A simple filter mechanism whereby you can tell this token stream
to force all tokens of type ttype to be on channel. For example,
when interpreting, we cannot exec actions so we need to tell
the stream to force all WS and NEWLINE to be a different, ignored
channel.
def google.appengine._internal.antlr3.streams.CommonTokenStream.skipOffTokenChannels |
( |
|
self, |
|
|
|
i |
|
) |
| |
Given a starting index, return the index of the first on-channel
token.
The documentation for this class was generated from the following file:
- code/googleappengine-read-only/python/google/appengine/_internal/antlr3/streams.py