Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TokenStreamSelector Class Reference

#include <TokenStreamSelector.hpp>

Inheritance diagram for TokenStreamSelector:

TokenStream List of all members.

Public Methods

 TokenStreamSelector ()
 ~TokenStreamSelector ()
void addInputStream (TokenStream *stream, const ANTLR_USE_NAMESPACE(std) string &key)
TokenStream * getCurrentStream () const
 Return the stream from which tokens are being pulled at the moment.

TokenStream * getStream (const ANTLR_USE_NAMESPACE(std) string &sname) const
RefToken nextToken ()
TokenStream * pop ()
void push (TokenStream *stream)
void push (const ANTLR_USE_NAMESPACE(std) string &sname)
void retry ()
void select (TokenStream *stream)
void select (const ANTLR_USE_NAMESPACE(std) string &sname)

Protected Types

typedef TokenStream * inputStreamNames_coll

Protected Methods

typedef ANTLR_USE_NAMESPACE (std) map< ANTLR_USE_NAMESPACE(std) string
typedef ANTLR_USE_NAMESPACE (std) stack< TokenStream * > streamStack_coll

Protected Attributes

inputStreamNames_coll inputStreamNames
TokenStream * 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.


Member Typedef Documentation

typedef TokenStream* TokenStreamSelector::inputStreamNames_coll [protected]
 


Constructor & Destructor Documentation

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 (    ) 
 


Member Function Documentation

void TokenStreamSelector::addInputStream (  TokenStream *    stream,
const ANTLR_USE_NAMESPACE(std) string &    key
) 
 

typedef TokenStreamSelector::ANTLR_USE_NAMESPACE (  std    )  [protected]
 

Used to track stack of input streams

typedef TokenStreamSelector::ANTLR_USE_NAMESPACE (  std    )  [protected]
 

The set of inputs to the MUX

TokenStream * TokenStreamSelector::getCurrentStream (    ) 
 

Return the stream from which tokens are being pulled at the moment.

TokenStream * TokenStreamSelector::getStream (  const ANTLR_USE_NAMESPACE(std) string &    sname )  const
 

RefToken TokenStreamSelector::nextToken (    )  [virtual]
 

Implements TokenStream.

TokenStream * TokenStreamSelector::pop (    ) 
 

void TokenStreamSelector::push (  const ANTLR_USE_NAMESPACE(std) string &    sname ) 
 

void TokenStreamSelector::push (  TokenStream *    stream ) 
 

void 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 TokenStreamSelector::select (  const ANTLR_USE_NAMESPACE(std) string &    sname ) 
 

void TokenStreamSelector::select (  TokenStream *    stream ) 
 

Set the stream without pushing old stream


Member Data Documentation

TokenStream* TokenStreamSelector::input [protected]
 

The currently-selected token stream input

inputStreamNames_coll TokenStreamSelector::inputStreamNames [protected]
 

streamStack_coll TokenStreamSelector::streamStack [protected]
 


The documentation for this class was generated from the following files:
Generated on Wed Nov 3 13:00:00 2004 for Lemur Toolkit by doxygen1.2.18