bsh
Class CommandLineReader

java.lang.Object
  |
  +--java.io.Reader
        |
        +--java.io.FilterReader
              |
              +--bsh.CommandLineReader

class CommandLineReader
extends java.io.FilterReader

This is a quick hack to turn empty lines entered interactively on the command line into ';\n' empty lines for the interpreter. It's just more pleasant to be able to hit return on an empty line and see the prompt reappear. This is *not* used when text is sourced from a file non-interactively.


Field Summary
(package private) static int lastCharNL
           
(package private) static int normal
           
(package private) static int sentSemi
           
(package private)  int state
           
 
Fields inherited from class java.io.FilterReader
in
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
CommandLineReader(java.io.Reader in)
           
 
Method Summary
static void main(java.lang.String[] args)
           
 int read()
           
 int read(char[] buff, int off, int len)
          This is a degenerate implementation.
 
Methods inherited from class java.io.FilterReader
close, mark, markSupported, ready, reset, skip
 
Methods inherited from class java.io.Reader
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

normal

static final int normal
See Also:
Constant Field Values

lastCharNL

static final int lastCharNL
See Also:
Constant Field Values

sentSemi

static final int sentSemi
See Also:
Constant Field Values

state

int state
Constructor Detail

CommandLineReader

public CommandLineReader(java.io.Reader in)
Method Detail

read

public int read()
         throws java.io.IOException
Overrides:
read in class java.io.FilterReader
java.io.IOException

read

public int read(char[] buff,
                int off,
                int len)
         throws java.io.IOException
This is a degenerate implementation. I don't know how to keep this from blocking if we try to read more than one char... There is no available() for Readers ??

Overrides:
read in class java.io.FilterReader
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
java.lang.Exception