org.jacaranda.verifier
Class JacarandaTokenStream

java.lang.Object
  extended by org.antlr.runtime.CommonTokenStream
      extended by org.antlr.runtime.TokenRewriteStream
          extended by org.jacaranda.verifier.JacarandaTokenStream
All Implemented Interfaces:
org.antlr.runtime.IntStream, org.antlr.runtime.TokenStream

public class JacarandaTokenStream
extends org.antlr.runtime.TokenRewriteStream

A subclass of TokenRewriteStream that allows rewinding to before a given token. Unlike the 'mark' functionality supported by ANTLR stream classes, this works for an arbitrary token without needing to set marks in advance. It is used to reset the lexer to expect a RegularExpressionLiteral when a '/' is encountered in an expression context.


Field Summary
protected  boolean eof
          true iff the 'tokens' list contains all tokens up to EOF.
 
Fields inherited from class org.antlr.runtime.TokenRewriteStream
DEFAULT_PROGRAM_NAME, lastRewriteTokenIndexes, MIN_TOKEN_INDEX, PROGRAM_INIT_SIZE, programs
 
Fields inherited from class org.antlr.runtime.CommonTokenStream
channel, channelOverrideMap, discardOffChannelTokens, discardSet, lastMarker, p, tokens, tokenSource
 
Constructor Summary
JacarandaTokenStream()
           
JacarandaTokenStream(org.antlr.runtime.TokenSource tokenSource)
           
JacarandaTokenStream(org.antlr.runtime.TokenSource tokenSource, int channel)
           
 
Method Summary
 void consume()
           
protected  void fillBuffer()
           
 org.antlr.runtime.Token get(int i)
           
 java.util.List getTokens(int start, int stop, org.antlr.runtime.BitSet types)
           
protected  org.antlr.runtime.Token LB(int k)
           
 org.antlr.runtime.Token LT(int k)
           
 void rewindToToken(org.antlr.runtime.Token token)
          Rewind the current position to the the given token.
 void seek(int index)
           
protected  int skipOffTokenChannels(int i)
           
protected  int skipOffTokenChannelsReverse(int i)
           
 java.lang.String toString(int start, int stop)
           
 
Methods inherited from class org.antlr.runtime.TokenRewriteStream
catOpText, delete, delete, delete, delete, delete, delete, deleteProgram, deleteProgram, getKindOfOps, getKindOfOps, getLastRewriteTokenIndex, getLastRewriteTokenIndex, getProgram, init, insertAfter, insertAfter, insertAfter, insertAfter, insertBefore, insertBefore, insertBefore, insertBefore, reduceToSingleOperationPerIndex, replace, replace, replace, replace, replace, replace, rollback, rollback, setLastRewriteTokenIndex, toDebugString, toDebugString, toOriginalString, toOriginalString, toString, toString, toString
 
Methods inherited from class org.antlr.runtime.CommonTokenStream
discardOffChannelTokens, discardTokenType, getSourceName, getTokens, getTokens, getTokens, getTokens, getTokenSource, index, LA, mark, release, reset, rewind, rewind, setTokenSource, setTokenTypeChannel, size, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

eof

protected boolean eof
true iff the 'tokens' list contains all tokens up to EOF.

Constructor Detail

JacarandaTokenStream

public JacarandaTokenStream()

JacarandaTokenStream

public JacarandaTokenStream(org.antlr.runtime.TokenSource tokenSource)

JacarandaTokenStream

public JacarandaTokenStream(org.antlr.runtime.TokenSource tokenSource,
                            int channel)
Method Detail

fillBuffer

protected void fillBuffer()
Overrides:
fillBuffer in class org.antlr.runtime.CommonTokenStream

consume

public void consume()
Specified by:
consume in interface org.antlr.runtime.IntStream
Overrides:
consume in class org.antlr.runtime.CommonTokenStream

skipOffTokenChannels

protected int skipOffTokenChannels(int i)
Overrides:
skipOffTokenChannels in class org.antlr.runtime.CommonTokenStream

skipOffTokenChannelsReverse

protected int skipOffTokenChannelsReverse(int i)
Overrides:
skipOffTokenChannelsReverse in class org.antlr.runtime.CommonTokenStream

LT

public org.antlr.runtime.Token LT(int k)
Specified by:
LT in interface org.antlr.runtime.TokenStream
Overrides:
LT in class org.antlr.runtime.CommonTokenStream

LB

protected org.antlr.runtime.Token LB(int k)
Overrides:
LB in class org.antlr.runtime.CommonTokenStream

get

public org.antlr.runtime.Token get(int i)
Specified by:
get in interface org.antlr.runtime.TokenStream
Overrides:
get in class org.antlr.runtime.CommonTokenStream

getTokens

public java.util.List getTokens(int start,
                                int stop,
                                org.antlr.runtime.BitSet types)
Overrides:
getTokens in class org.antlr.runtime.CommonTokenStream

seek

public void seek(int index)
Specified by:
seek in interface org.antlr.runtime.IntStream
Overrides:
seek in class org.antlr.runtime.CommonTokenStream

toString

public java.lang.String toString(int start,
                                 int stop)
Specified by:
toString in interface org.antlr.runtime.TokenStream
Overrides:
toString in class org.antlr.runtime.TokenRewriteStream

rewindToToken

public void rewindToToken(org.antlr.runtime.Token token)
Rewind the current position to the the given token. Assumes that the TokenSource has already been rewound to the corresponding position in its CharStream.