Package com.jogamp.gluegen.jcpp
Class DefaultPreprocessorListener
- java.lang.Object
-
- com.jogamp.gluegen.jcpp.DefaultPreprocessorListener
-
- All Implemented Interfaces:
PreprocessorListener
public class DefaultPreprocessorListener extends Object implements PreprocessorListener
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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jogamp.gluegen.jcpp.PreprocessorListener
PreprocessorListener.SourceChangeEvent
-
-
Constructor Summary
Constructors Constructor Description DefaultPreprocessorListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
int
getErrors()
int
getWarnings()
void
handleError(Source source, int line, int column, String msg)
Handles an error.void
handleSourceChange(Source source, PreprocessorListener.SourceChangeEvent event)
void
handleWarning(Source source, int line, int column, String msg)
Handles a warning.protected void
print(String msg)
-
-
-
Method Detail
-
clear
public void clear()
-
getErrors
@Nonnegative public int getErrors()
-
getWarnings
@Nonnegative public int getWarnings()
-
print
protected void print(@Nonnull 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.- Specified by:
handleWarning
in interfacePreprocessorListener
- 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.- Specified by:
handleError
in interfacePreprocessorListener
- Throws:
LexerException
-
handleSourceChange
public void handleSourceChange(Source source, PreprocessorListener.SourceChangeEvent event)
- Specified by:
handleSourceChange
in interfacePreprocessorListener
-
-