antlr::TokenStreamSelector Class Reference
#include <TokenStreamSelector.hpp>
List of all members.
Detailed Description
A token stream MUX (multiplexor) knows about n token streams and can multiplex them onto the same channel for use by token stream consumer like a parser. This is a way to have multiple lexers break up the same input stream for a single parser. Or, you can have multiple instances of the same lexer handle multiple input streams; this works great for includes.
Member Typedef Documentation
The set of inputs to the MUX
Used to track stack of input streams
Constructor & Destructor Documentation
antlr::TokenStreamSelector::TokenStreamSelector |
( |
|
) |
|
A token stream MUX (multiplexor) knows about n token streams and can multiplex them onto the same channel for use by token stream consumer like a parser. This is a way to have multiple lexers break up the same input stream for a single parser. Or, you can have multiple instances of the same lexer handle multiple input streams; this works great for includes.
antlr::TokenStreamSelector::~TokenStreamSelector |
( |
|
) |
|
Member Function Documentation
void antlr::TokenStreamSelector::addInputStream |
( |
TokenStream * |
stream, |
|
|
const std::string & |
key | |
|
) |
| | |
TokenStream * antlr::TokenStreamSelector::getCurrentStream |
( |
|
) |
const |
Return the stream from which tokens are being pulled at the moment.
TokenStream * antlr::TokenStreamSelector::getStream |
( |
const std::string & |
sname |
) |
const |
RefToken antlr::TokenStreamSelector::nextToken |
( |
void |
|
) |
[virtual] |
void antlr::TokenStreamSelector::push |
( |
const std::string & |
sname |
) |
|
void antlr::TokenStreamSelector::push |
( |
TokenStream * |
stream |
) |
|
void antlr::TokenStreamSelector::retry |
( |
|
) |
|
Abort recognition of current Token and try again. A stream can push a new stream (for include files for example, and then retry(), which will cause the current stream to abort back to this.nextToken(). this.nextToken() then asks for a token from the current stream, which is the new "substream."
void antlr::TokenStreamSelector::select |
( |
const std::string & |
sname |
) |
|
void antlr::TokenStreamSelector::select |
( |
TokenStream * |
stream |
) |
|
Set the stream without pushing old stream
Member Data Documentation
The currently-selected token stream input
The documentation for this class was generated from the following files: