org.anarres.cpp
Class PreprocessorListener

java.lang.Object
  extended by org.anarres.cpp.PreprocessorListener

public class PreprocessorListener
extends Object

A handler for preprocessor events, primarily errors and warnings. If no PreprocessorListener is installed in a Preprocessor, all error and warning events will throw an exception. Installing a listener allows more intelligent handling of these events.


Constructor Summary
PreprocessorListener()
           
 
Method Summary
 void clear()
           
 int getErrors()
           
 int getWarnings()
           
 void handleError(Source source, int line, int column, String msg)
          Handles an error.
 void handleSourceChange(Source source, String event)
           
 void handleWarning(Source source, int line, int column, String msg)
          Handles a warning.
protected  void print(String msg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreprocessorListener

public PreprocessorListener()
Method Detail

clear

public void clear()

getErrors

public int getErrors()

getWarnings

public int getWarnings()

print

protected void print(String msg)

handleWarning

public void handleWarning(Source source,
                          int line,
                          int column,
                          String msg)
                   throws LexerException
Handles a warning. The behaviour of this method is defined by the implementation. It may simply record the error message, or it may throw an exception.

Throws:
LexerException

handleError

public void handleError(Source source,
                        int line,
                        int column,
                        String msg)
                 throws LexerException
Handles an error. The behaviour of this method is defined by the implementation. It may simply record the error message, or it may throw an exception.

Throws:
LexerException

handleSourceChange

public void handleSourceChange(Source source,
                               String event)


Copyright © 2007 Shevek, Anarres. All Rights Reserved.