net.janino
Class Scanner

java.lang.Object
  |
  +--net.janino.Scanner

public class Scanner
extends java.lang.Object

Splits up a character stream into tokens and returns them as String objects.


Inner Class Summary
static class Scanner.Location
           
static class Scanner.ScanException
          An exception that reflects an error during parsing.
 class Scanner.Token
           
 
Field Summary
(package private) static java.lang.String cvs_header
           
 
Constructor Summary
Scanner(java.lang.String fileName)
          Set up a scanner that reads tokens from the given file in the platform default encoding.
Scanner(java.lang.String fileName, java.io.InputStream is)
          Set up a scanner that reads tokens from the given java.io.InputStream in the platform default encoding.
Scanner(java.lang.String fileName, java.io.Reader in)
          Set up a scanner that reads tokens from the given java.io.Reader.
 
Method Summary
(package private) static void ()
           
(package private) static void ()
           
 void close()
           
 Scanner.Token peek()
          Peek the next token, but don't remove it from the input.
 Scanner.Token peekNextButOne()
          Peek the next but one token, neither remove the next nor the next but one token from the input.
 Scanner.Token read()
          Read the next token from the input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cvs_header

static final java.lang.String cvs_header
Constructor Detail

Scanner

public Scanner(java.lang.String fileName)
        throws Scanner.ScanException,
               java.io.IOException
Set up a scanner that reads tokens from the given file in the platform default encoding.
Parameters:
fileName -  
Throws:
Scanner.ScanException -  
java.io.IOException -  

Scanner

public Scanner(java.lang.String fileName,
               java.io.InputStream is)
        throws Scanner.ScanException,
               java.io.IOException
Set up a scanner that reads tokens from the given java.io.InputStream in the platform default encoding.

The fileName is solely used for reporting in thrown exceptions.

Parameters:
fileName -  
is -  
Throws:
Scanner.ScanException -  
java.io.IOException -  

Scanner

public Scanner(java.lang.String fileName,
               java.io.Reader in)
        throws Scanner.ScanException,
               java.io.IOException
Set up a scanner that reads tokens from the given java.io.Reader.

The fileName is solely used for reporting in thrown exceptions.

Parameters:
fileName -  
in -  
Throws:
Scanner.ScanException -  
java.io.IOException -  
Method Detail

close

public void close()
           throws java.io.IOException

read

public Scanner.Token read()
                   throws Scanner.ScanException,
                          java.io.IOException
Read the next token from the input.

peek

public Scanner.Token peek()
Peek the next token, but don't remove it from the input.

peekNextButOne

public Scanner.Token peekNextButOne()
Peek the next but one token, neither remove the next nor the next but one token from the input.

static void ()

static void ()