antlr
Class TokenStreamHiddenTokenFilter

java.lang.Object
  |
  +--antlr.TokenStreamBasicFilter
        |
        +--antlr.TokenStreamHiddenTokenFilter
All Implemented Interfaces:
TokenStream

public class TokenStreamHiddenTokenFilter
extends TokenStreamBasicFilter
implements TokenStream

Untamed: 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.


Field Summary
protected  CommonHiddenStreamToken firstHidden
           
protected  BitSet hideMask
           
protected  CommonHiddenStreamToken lastHiddenToken
          track tail of hidden list emanating from previous monitored token
private  CommonHiddenStreamToken nextMonitoredToken
           
 
Fields inherited from class antlr.TokenStreamBasicFilter
discardMask, input
 
Constructor Summary
TokenStreamHiddenTokenFilter(TokenStream input)
          Enabled:
 
Method Summary
protected  void consume()
           
private  void consumeFirst()
           
 BitSet getDiscardMask()
          Enabled:
 CommonHiddenStreamToken getHiddenAfter(CommonHiddenStreamToken t)
          Enabled: Return a ptr to the hidden token appearing immediately after token t in the input stream.
 CommonHiddenStreamToken getHiddenBefore(CommonHiddenStreamToken t)
          Enabled: Return a ptr to the hidden token appearing immediately before token t in the input stream.
 BitSet getHideMask()
          Enabled:
 CommonHiddenStreamToken getInitialHiddenToken()
          Enabled: Return the first hidden token if one appears before any monitored token.
 void hide(BitSet mask)
          Enabled:
 void hide(int m)
          Enabled:
protected  CommonHiddenStreamToken LA(int i)
           
 Token nextToken()
          Enabled: Return the next monitored token.
 
Methods inherited from class antlr.TokenStreamBasicFilter
discard, discard
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hideMask

protected BitSet hideMask

nextMonitoredToken

private CommonHiddenStreamToken nextMonitoredToken

lastHiddenToken

protected CommonHiddenStreamToken lastHiddenToken
track tail of hidden list emanating from previous monitored token


firstHidden

protected CommonHiddenStreamToken firstHidden
Constructor Detail

TokenStreamHiddenTokenFilter

public TokenStreamHiddenTokenFilter(TokenStream input)
Enabled:

Method Detail

consume

protected void consume()
                throws TokenStreamException
TokenStreamException

consumeFirst

private void consumeFirst()
                   throws TokenStreamException
TokenStreamException

getDiscardMask

public BitSet getDiscardMask()
Enabled:


getHiddenAfter

public CommonHiddenStreamToken getHiddenAfter(CommonHiddenStreamToken t)
Enabled: Return a ptr to the hidden token appearing immediately after token t in the input stream.


getHiddenBefore

public CommonHiddenStreamToken getHiddenBefore(CommonHiddenStreamToken t)
Enabled: Return a ptr to the hidden token appearing immediately before token t in the input stream.


getHideMask

public BitSet getHideMask()
Enabled:


getInitialHiddenToken

public CommonHiddenStreamToken getInitialHiddenToken()
Enabled: Return the first hidden token if one appears before any monitored token.


hide

public void hide(int m)
Enabled:


hide

public void hide(BitSet mask)
Enabled:


LA

protected CommonHiddenStreamToken LA(int i)

nextToken

public Token nextToken()
                throws TokenStreamException
Enabled: 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.

Specified by:
nextToken in interface TokenStream
Overrides:
nextToken in class TokenStreamBasicFilter
TokenStreamException


comments?