org.codehaus.groovy.syntax
Interface TokenStream

All Known Implementing Classes:
AbstractTokenStream

public interface TokenStream


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.
 

Method Detail

la

public org.codehaus.groovy.syntax.Token la()
                                    throws IOException,
                                           SyntaxException
Look-ahead to the next token.

This method is equivalent to la(1).

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:
la(int)

la

public org.codehaus.groovy.syntax.Token la(int k)
                                    throws IOException,
                                           SyntaxException
Look-ahead to the kth token.

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
Consume the next token.

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

getSourceLocator

public String getSourceLocator()


Copyright © 2003 The Codehaus. All Rights Reserved.