org.codehaus.groovy.syntax
Class AbstractTokenStream

java.lang.Object
  |
  +--org.codehaus.groovy.syntax.AbstractTokenStream
All Implemented Interfaces:
TokenStream
Direct Known Subclasses:
LexerTokenStream

public abstract class AbstractTokenStream
extends Object
implements TokenStream


Constructor Summary
AbstractTokenStream()
           
AbstractTokenStream(String sourceLocator)
           
 
Method Summary
 org.codehaus.groovy.syntax.Token consume(int type)
          Consume the next token.
 String getSourceLocator()
           
 org.codehaus.groovy.syntax.Token la()
          Look-ahead to the next token.
 org.codehaus.groovy.syntax.Token la(int k)
          Look-ahead to the kth token.
protected abstract  org.codehaus.groovy.syntax.Token nextToken()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTokenStream

public AbstractTokenStream()

AbstractTokenStream

public AbstractTokenStream(String sourceLocator)
Method Detail

getSourceLocator

public String getSourceLocator()
Specified by:
getSourceLocator in interface TokenStream

nextToken

protected abstract org.codehaus.groovy.syntax.Token nextToken()
                                                       throws IOException,
                                                              SyntaxException
IOException
SyntaxException

la

public org.codehaus.groovy.syntax.Token la()
                                    throws IOException,
                                           SyntaxException
Description copied from interface: TokenStream
Look-ahead to the next token.

This method is equivalent to la(1).

Specified by:
la in interface TokenStream
Returns:
The next token or null if no more tokens available.
Throws:
IOException - If an error occurs attempting to lookahead a token.
SyntaxException
See Also:
TokenStream.la(int)

la

public org.codehaus.groovy.syntax.Token la(int k)
                                    throws IOException,
                                           SyntaxException
Description copied from interface: TokenStream
Look-ahead to the kth token.

Specified by:
la in interface TokenStream
Parameters:
k - Number of token to look ahead.
Returns:
the kth token or null if no more tokens available.
Throws:
IOException - If an error occurs attempting to lookahead a token.
SyntaxException

consume

public org.codehaus.groovy.syntax.Token consume(int type)
                                         throws IOException,
                                                SyntaxException
Description copied from interface: TokenStream
Consume the next token.

Specified by:
consume in interface TokenStream
Parameters:
type - The token type.
Returns:
The consumed token or null if no more tokens available.
Throws:
IOException - If an error occurs attempting to consume a token.
SyntaxException


Copyright © 2003 The Codehaus. All Rights Reserved.