polyglot.util
Class StdErrorQueue

java.lang.Object
  extended by polyglot.util.AbstractErrorQueue
      extended by polyglot.util.StdErrorQueue
All Implemented Interfaces:
ErrorQueue

public class StdErrorQueue
extends AbstractErrorQueue

A StdErrorQueue handles outputing error messages.


Field Summary
 
Fields inherited from class polyglot.util.AbstractErrorQueue
errorCount, flushed, limit, name
 
Constructor Summary
StdErrorQueue(java.io.PrintStream err, int limit, java.lang.String name)
           
 
Method Summary
 void displayError(ErrorInfo e)
           
 void flush()
          This method is called to flush the error queue.
protected  java.io.Reader reader(Position pos)
           
protected  void showErrorIndicator(Position pos, int lineNum, java.lang.String s)
           
protected  void tooManyErrors(ErrorInfo lastError)
          This method is called when we have had too many errors.
 
Methods inherited from class polyglot.util.AbstractErrorQueue
enqueue, enqueue, enqueue, errorCount, hasErrors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StdErrorQueue

public StdErrorQueue(java.io.PrintStream err,
                     int limit,
                     java.lang.String name)
Method Detail

displayError

public void displayError(ErrorInfo e)
Specified by:
displayError in class AbstractErrorQueue

tooManyErrors

protected void tooManyErrors(ErrorInfo lastError)
Description copied from class: AbstractErrorQueue
This method is called when we have had too many errors. This method give subclasses the opportunity to output appropriate messages, or tidy up.

Overrides:
tooManyErrors in class AbstractErrorQueue
Parameters:
lastError - the last error that pushed us over the limit

reader

protected java.io.Reader reader(Position pos)
                         throws java.io.IOException
Throws:
java.io.IOException

showErrorIndicator

protected void showErrorIndicator(Position pos,
                                  int lineNum,
                                  java.lang.String s)

flush

public void flush()
Description copied from class: AbstractErrorQueue
This method is called to flush the error queue. Subclasses may want to print summary information in this method.

Specified by:
flush in interface ErrorQueue
Overrides:
flush in class AbstractErrorQueue