OpenMD 3.1
Molecular Dynamics in the Open
|
This object filters a token stream coming from a lexer or another TokenStream so that only certain token channels get transmitted to the parser. More...
#include <TokenStreamHiddenTokenFilter.hpp>
Public Member Functions | |
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. | |
BitSet | getDiscardMask () const |
RefToken | getHiddenAfter (RefToken t) |
Return a ptr to the hidden token appearing immediately after token t in the input stream. | |
RefToken | getHiddenBefore (RefToken t) |
Return a ptr to the hidden token appearing immediately before token t in the input stream. | |
BitSet | getHideMask () const |
RefToken | getInitialHiddenToken () |
Return the first hidden token if one appears before any monitored token. | |
void | hide (int m) |
void | hide (const BitSet &mask) |
RefToken | nextToken () |
Return the next monitored token. | |
Public Member Functions inherited from antlr::TokenStreamBasicFilter | |
TokenStreamBasicFilter (TokenStream &input_) | |
This object is a TokenStream that passes through all tokens except for those that you tell it to discard. | |
void | discard (int ttype) |
void | discard (const BitSet &mask) |
Protected Member Functions | |
void | consume () |
RefToken | LA (int i) |
Protected Attributes | |
BitSet | hideMask |
RefToken | lastHiddenToken |
track tail of hidden list emanating from previous monitored token | |
RefToken | firstHidden |
Protected Attributes inherited from antlr::TokenStreamBasicFilter | |
BitSet | discardMask |
The set of token types to discard. | |
TokenStream * | input |
The input stream. | |
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.
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.
|
protected |
Definition at line 27 of file TokenStreamHiddenTokenFilter.cpp.
BitSet antlr::TokenStreamHiddenTokenFilter::getDiscardMask | ( | ) | const |
Definition at line 58 of file TokenStreamHiddenTokenFilter.cpp.
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 getHiddenAfter().
Referenced by getHiddenAfter().
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 getHiddenBefore().
Referenced by getHiddenBefore().
BitSet antlr::TokenStreamHiddenTokenFilter::getHideMask | ( | ) | const |
Definition at line 79 of file TokenStreamHiddenTokenFilter.cpp.
RefToken antlr::TokenStreamHiddenTokenFilter::getInitialHiddenToken | ( | ) |
Return the first hidden token if one appears before any monitored token.
Definition at line 87 of file TokenStreamHiddenTokenFilter.cpp.
void antlr::TokenStreamHiddenTokenFilter::hide | ( | const BitSet & | mask | ) |
Definition at line 97 of file TokenStreamHiddenTokenFilter.cpp.
void antlr::TokenStreamHiddenTokenFilter::hide | ( | int | m | ) |
Definition at line 92 of file TokenStreamHiddenTokenFilter.cpp.
|
protected |
Definition at line 102 of file TokenStreamHiddenTokenFilter.cpp.
|
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 antlr::TokenStreamBasicFilter::discardMask, and lastHiddenToken.
|
protected |
Definition at line 39 of file TokenStreamHiddenTokenFilter.hpp.
|
protected |
Definition at line 28 of file TokenStreamHiddenTokenFilter.hpp.
|
protected |
track tail of hidden list emanating from previous monitored token
Definition at line 37 of file TokenStreamHiddenTokenFilter.hpp.
Referenced by nextToken().