OpenMD  2.5
Molecular Dynamics in the Open
antlr::TokenStreamHiddenTokenFilter Class Reference

#include <TokenStreamHiddenTokenFilter.hpp>

Inheritance diagram for antlr::TokenStreamHiddenTokenFilter:
antlr::TokenStreamBasicFilter antlr::TokenStream

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 ()
 
- Public Member Functions inherited from antlr::TokenStreamBasicFilter
 TokenStreamBasicFilter (TokenStream &input_)
 
void discard (int ttype)
 
void discard (const BitSet &mask)
 
- Public Member Functions inherited from antlr::TokenStream
virtual ~TokenStream ()
 

Protected Member Functions

void consume ()
 
RefToken LA (int i)
 

Protected Attributes

BitSet hideMask
 
RefToken lastHiddenToken
 
RefToken firstHidden
 
- Protected Attributes inherited from antlr::TokenStreamBasicFilter
BitSet discardMask
 
TokenStreaminput
 

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

antlr::TokenStreamHiddenTokenFilter::TokenStreamHiddenTokenFilter ( TokenStream input)

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 22 of file TokenStreamHiddenTokenFilter.cpp.

Member Function Documentation

◆ consume()

void antlr::TokenStreamHiddenTokenFilter::consume ( )
protected

◆ consumeFirst()

void antlr::TokenStreamHiddenTokenFilter::consumeFirst ( )
private

◆ getDiscardMask()

BitSet antlr::TokenStreamHiddenTokenFilter::getDiscardMask ( ) const

◆ getHiddenAfter()

RefToken antlr::TokenStreamHiddenTokenFilter::getHiddenAfter ( RefToken  t)

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

Definition at line 66 of file TokenStreamHiddenTokenFilter.cpp.

References antlr::TokenRefCount< T >::get().

◆ getHiddenBefore()

RefToken antlr::TokenStreamHiddenTokenFilter::getHiddenBefore ( RefToken  t)

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

Definition at line 74 of file TokenStreamHiddenTokenFilter.cpp.

References antlr::TokenRefCount< T >::get().

◆ getHideMask()

BitSet antlr::TokenStreamHiddenTokenFilter::getHideMask ( ) const

Definition at line 79 of file TokenStreamHiddenTokenFilter.cpp.

References hideMask.

◆ getInitialHiddenToken()

RefToken antlr::TokenStreamHiddenTokenFilter::getInitialHiddenToken ( )

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

Definition at line 87 of file TokenStreamHiddenTokenFilter.cpp.

References firstHidden.

◆ hide() [1/2]

void antlr::TokenStreamHiddenTokenFilter::hide ( int  m)

Definition at line 92 of file TokenStreamHiddenTokenFilter.cpp.

References antlr::BitSet::add(), and hideMask.

◆ hide() [2/2]

void antlr::TokenStreamHiddenTokenFilter::hide ( const BitSet mask)

Definition at line 97 of file TokenStreamHiddenTokenFilter.cpp.

References hideMask.

◆ LA()

RefToken antlr::TokenStreamHiddenTokenFilter::LA ( int  i)
protected

Definition at line 102 of file TokenStreamHiddenTokenFilter.cpp.

References nextMonitoredToken.

Referenced by consumeFirst(), and nextToken().

◆ nextToken()

RefToken antlr::TokenStreamHiddenTokenFilter::nextToken ( void  )
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 antlr::TokenStreamBasicFilter.

Definition at line 117 of file TokenStreamHiddenTokenFilter.cpp.

References consume(), consumeFirst(), antlr::TokenStreamBasicFilter::discardMask, antlr::TokenRefCount< T >::get(), hideMask, LA(), lastHiddenToken, antlr::BitSet::member(), and antlr::nullToken.

Member Data Documentation

◆ firstHidden

RefToken antlr::TokenStreamHiddenTokenFilter::firstHidden
protected

Definition at line 39 of file TokenStreamHiddenTokenFilter.hpp.

Referenced by consumeFirst(), and getInitialHiddenToken().

◆ hideMask

BitSet antlr::TokenStreamHiddenTokenFilter::hideMask
protected

Definition at line 28 of file TokenStreamHiddenTokenFilter.hpp.

Referenced by consumeFirst(), getHideMask(), hide(), and nextToken().

◆ lastHiddenToken

RefToken antlr::TokenStreamHiddenTokenFilter::lastHiddenToken
protected

track tail of hidden list emanating from previous monitored token

Definition at line 37 of file TokenStreamHiddenTokenFilter.hpp.

Referenced by consumeFirst(), and nextToken().

◆ nextMonitoredToken

RefToken antlr::TokenStreamHiddenTokenFilter::nextMonitoredToken
private

Definition at line 31 of file TokenStreamHiddenTokenFilter.hpp.

Referenced by consume(), and LA().


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