TokenStreamHiddenTokenFilter Class Reference

#include <TokenStreamHiddenTokenFilter.hpp>

Inheritance diagram for TokenStreamHiddenTokenFilter:

Inheritance graph
Collaboration diagram for TokenStreamHiddenTokenFilter:

Collaboration graph

Public Member Functions

 TokenStreamHiddenTokenFilter (TokenStream &input)
BitSet getDiscardMask () const
RefToken getHiddenAfter (RefToken t)
RefToken getHiddenBefore (RefToken t)
BitSet getHideMask () const
RefToken getInitialHiddenToken ()
void hide (int m)
void hide (const BitSet &mask)
RefToken nextToken ()

Protected Member Functions

void consume ()
RefToken LA (int i)

Protected Attributes

BitSet hideMask
RefToken lastHiddenToken
RefToken firstHidden

Private Member Functions

void consumeFirst ()

Private Attributes

RefToken nextMonitoredToken

Detailed Description

This object filters a token stream coming from a lexer or another TokenStream so that only certain token channels get transmitted to the parser.

Any of the channels can be filtered off as "hidden" channels whose tokens can be accessed from the parser.

Definition at line 25 of file TokenStreamHiddenTokenFilter.hpp.

Constructor & Destructor Documentation

TokenStreamHiddenTokenFilter::TokenStreamHiddenTokenFilter ( TokenStream input  ) 

Member Function Documentation

void TokenStreamHiddenTokenFilter::consume (  )  [protected]

void TokenStreamHiddenTokenFilter::consumeFirst (  )  [private]

BitSet TokenStreamHiddenTokenFilter::getDiscardMask (  )  const

RefToken TokenStreamHiddenTokenFilter::getHiddenAfter ( RefToken  t  ) 

Return a ptr to the hidden token appearing immediately after token t in the input stream.

RefToken TokenStreamHiddenTokenFilter::getHiddenBefore ( RefToken  t  ) 

Return a ptr to the hidden token appearing immediately before token t in the input stream.

BitSet TokenStreamHiddenTokenFilter::getHideMask (  )  const

RefToken TokenStreamHiddenTokenFilter::getInitialHiddenToken (  ) 

Return the first hidden token if one appears before any monitored token.

void TokenStreamHiddenTokenFilter::hide ( int  m  ) 

void TokenStreamHiddenTokenFilter::hide ( const BitSet mask  ) 

RefToken TokenStreamHiddenTokenFilter::LA ( int  i  )  [protected]

RefToken TokenStreamHiddenTokenFilter::nextToken (  )  [virtual]

Return the next monitored token. Test the token following the monitored token. If following is another monitored token, save it for the next invocation of nextToken (like a single lookahead token) and return it then. If following is unmonitored, nondiscarded (hidden) channel token, add it to the monitored token.

Note: EOF must be a monitored Token.

Reimplemented from TokenStreamBasicFilter.

Field Documentation

Definition at line 28 of file TokenStreamHiddenTokenFilter.hpp.

Definition at line 31 of file TokenStreamHiddenTokenFilter.hpp.

track tail of hidden list emanating from previous monitored token

Definition at line 37 of file TokenStreamHiddenTokenFilter.hpp.

Definition at line 39 of file TokenStreamHiddenTokenFilter.hpp.

The documentation for this class was generated from the following file:

Generated on Tue Mar 31 20:19:28 2009 for ctrump by  doxygen 1.5.6