TokenStreamSelector Class Reference
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. More...
#include <TokenStreamSelector.hpp>
Inheritance diagram for TokenStreamSelector:


Public Member Functions | |
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. | |
~TokenStreamSelector () | |
void | addInputStream (TokenStream *stream, const std::string &key) |
TokenStream * | getCurrentStream () const |
Return the stream from which tokens are being pulled at the moment. | |
TokenStream * | getStream (const std::string &sname) const |
RefToken | nextToken () |
TokenStream * | pop () |
void | push (TokenStream *stream) |
void | push (const std::string &sname) |
void | retry () |
Abort recognition of current Token and try again. | |
void | select (TokenStream *stream) |
Set the stream without pushing old stream. | |
void | select (const std::string &sname) |
Protected Types | |
typedef std::map< std::string, TokenStream * > | inputStreamNames_coll |
The set of inputs to the MUX. | |
typedef std::stack< TokenStream * > | streamStack_coll |
Used to track stack of input streams. | |
Protected Attributes | |
inputStreamNames_coll | inputStreamNames |
TokenStream * | input |
The currently-selected token stream input. | |
streamStack_coll | streamStack |
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.
Definition at line 27 of file TokenStreamSelector.hpp.
Member Typedef Documentation
|
The set of inputs to the MUX.
Definition at line 34 of file TokenStreamSelector.hpp. |
|
Used to track stack of input streams.
Definition at line 45 of file TokenStreamSelector.hpp. |
Constructor & Destructor Documentation
|
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. Definition at line 22 of file TokenStreamSelector.cpp. |
|
Definition at line 27 of file TokenStreamSelector.cpp. |
Member Function Documentation
|
Definition at line 31 of file TokenStreamSelector.cpp. References inputStreamNames. |
|
Return the stream from which tokens are being pulled at the moment.
Definition at line 36 of file TokenStreamSelector.cpp. |
|
Definition at line 41 of file TokenStreamSelector.cpp. References ANTLR_USE_NAMESPACE, and inputStreamNames. |
|
Implements TokenStream. Definition at line 50 of file TokenStreamSelector.cpp. References input, TokenStream::nextToken(), and RefToken. |
|
Definition at line 64 of file TokenStreamSelector.cpp. References select(), and streamStack. |
|
Definition at line 78 of file TokenStreamSelector.cpp. References input, select(), and streamStack. |
|
Definition at line 72 of file TokenStreamSelector.cpp. References input, select(), and streamStack. |
|
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." Definition at line 84 of file TokenStreamSelector.cpp. |
|
Definition at line 95 of file TokenStreamSelector.cpp. References ANTLR_USE_NAMESPACE, input, and inputStreamNames. |
|
Set the stream without pushing old stream.
Definition at line 90 of file TokenStreamSelector.cpp. References input. |
Member Data Documentation
|
The currently-selected token stream input.
Definition at line 39 of file TokenStreamSelector.hpp. Referenced by nextToken(), push(), and select(). |
|
Definition at line 36 of file TokenStreamSelector.hpp. Referenced by addInputStream(), getStream(), and select(). |
|
Definition at line 47 of file TokenStreamSelector.hpp. |
The documentation for this class was generated from the following files:
- lib/antlr/antlr/TokenStreamSelector.hpp
- lib/antlr/src/TokenStreamSelector.cpp