|
ANTLR Support Libraries 2.7.1+
|
#include <TokenStreamSelector.hpp>


Public Member Functions | |
| TokenStreamSelector () | |
| ~TokenStreamSelector () | |
| void | addInputStream (TokenStream *stream, const std::string &key) |
| TokenStream * | getCurrentStream () const |
| Return the stream from which tokens are being pulled at the moment. More... | |
| TokenStream * | getStream (const std::string &sname) const |
| RefToken | nextToken () |
| TokenStream * | pop () |
| void | push (TokenStream *stream) |
| void | push (const std::string &sname) |
| void | retry () |
| void | select (TokenStream *stream) |
| void | select (const std::string &sname) |
Public Member Functions inherited from TokenStream | |
| virtual | ~TokenStream () |
Protected Types | |
| typedef std::map< std::string, TokenStream * > | inputStreamNames_coll |
| typedef std::stack< TokenStream * > | streamStack_coll |
Protected Attributes | |
| inputStreamNames_coll | inputStreamNames |
| TokenStream * | input |
| streamStack_coll | streamStack |
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.
|
protected |
The set of inputs to the MUX
|
protected |
Used to track stack of input streams
| 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.
| TokenStreamSelector::~TokenStreamSelector | ( | ) |
| void TokenStreamSelector::addInputStream | ( | TokenStream * | stream, |
| const std::string & | key | ||
| ) |
| TokenStream * TokenStreamSelector::getCurrentStream | ( | ) | const |
Return the stream from which tokens are being pulled at the moment.
| TokenStream * TokenStreamSelector::getStream | ( | const std::string & | sname | ) | const |
|
virtual |
Implements TokenStream.
| TokenStream * TokenStreamSelector::pop | ( | ) |
| void TokenStreamSelector::push | ( | TokenStream * | stream | ) |
| void TokenStreamSelector::push | ( | const std::string & | sname | ) |
| void TokenStreamSelector::retry | ( | ) |
| void TokenStreamSelector::select | ( | TokenStream * | stream | ) |
Set the stream without pushing old stream
| void TokenStreamSelector::select | ( | const std::string & | sname | ) |
|
protected |
The currently-selected token stream input
|
protected |
|
protected |
1.8.5