@Override public Token token() throws IOException, LexerException { throw new LexerException("Cannot read from " + getName()); }
protected void error(int line, int column, String msg) throws LexerException { if (listener != null) listener.handleError(this, line, column, msg); else throw new LexerException("Error at " + line + ":" + column + ": " + msg); }
protected void warning(String msg) throws LexerException { if (source != null) source.warning(msg); else throw new LexerException(msg); }
protected void error(int line, int column, String msg) throws LexerException { if (listener != null) listener.handleError(this, line, column, msg); else throw new LexerException("Error at " + line + ":" + column + ": " + msg); }
@Override public Token token() throws IOException, LexerException { throw new LexerException("Cannot read from " + getName()); } @Override
protected void error(int line, int column, String msg) throws LexerException { if (listener != null) listener.handleError(this, line, column, msg); else throw new LexerException("Error at " + line + ":" + column + ": " + msg); }
protected void warning(String msg) throws LexerException { if (source != null) source.warning(msg); else throw new LexerException(msg); }
@Override public Token token() throws IOException, LexerException { throw new LexerException("Cannot read from " + getName()); } @Override
protected void warning(String msg) throws LexerException { if (source != null) source.warning(msg); else throw new LexerException(msg); }
/** * Handles an error. * * If a PreprocessorListener is installed, it receives the * error. Otherwise, an exception is thrown. */ protected void error(int line, int column, @Nonnull String msg) throws LexerException { if (listener != null) listener.handleError(source, line, column, msg); else throw new LexerException("Error at " + line + ":" + column + ": " + msg); }
/** * Handles an error. * * If a PreprocessorListener is installed, it receives the * error. Otherwise, an exception is thrown. */ protected void error(int line, int column, String msg) throws LexerException { if (listener != null) listener.handleError(source, line, column, msg); else throw new LexerException("Error at " + line + ":" + column + ": " + msg); }
/** * Handles an error. * * If a PreprocessorListener is installed, it receives the * error. Otherwise, an exception is thrown. */ protected void error(int line, int column, String msg) throws LexerException { if (listener != null) listener.handleError(source, line, column, msg); else throw new LexerException("Error at " + line + ":" + column + ": " + msg); }
/** * Adds a Macro to this Preprocessor. * * The given {@link Macro} object encapsulates both the name * and the expansion. */ public void addMacro(Macro m) throws LexerException { // System.out.println("Macro " + m); String name = m.getName(); /* Already handled as a source error in macro(). */ if ("defined".equals(name)) throw new LexerException("Cannot redefine name 'defined'"); macros.put(m.getName(), m); }
/** * Adds a Macro to this Preprocessor. * * The given {@link Macro} object encapsulates both the name * and the expansion. */ public void addMacro(Macro m) throws LexerException { // System.out.println("Macro " + m); String name = m.getName(); /* Already handled as a source error in macro(). */ if ("defined".equals(name)) throw new LexerException("Cannot redefine name 'defined'"); macros.put(m.getName(), m); }
/** * Handles a warning. * * If a PreprocessorListener is installed, it receives the * warning. Otherwise, an exception is thrown. */ protected void warning(int line, int column, String msg) throws LexerException { if (warnings.contains(Warning.ERROR)) error(line, column, msg); else if (listener != null) listener.handleWarning(source, line, column, msg); else throw new LexerException("Warning at " + line + ":" + column + ": " + msg); }
protected void warning(int line, int column, String msg) throws LexerException { if (werror) error(line, column, msg); else if (listener != null) listener.handleWarning(this, line, column, msg); else throw new LexerException("Warning at " + line + ":" + column + ": " + msg); }
/** * Handles a warning. * * If a PreprocessorListener is installed, it receives the * warning. Otherwise, an exception is thrown. */ protected void warning(int line, int column, String msg) throws LexerException { if (warnings.contains(Warning.ERROR)) error(line, column, msg); else if (listener != null) listener.handleWarning(source, line, column, msg); else throw new LexerException("Warning at " + line + ":" + column + ": " + msg); }
protected void warning(int line, int column, String msg) throws LexerException { if (werror) error(line, column, msg); else if (listener != null) listener.handleWarning(this, line, column, msg); else throw new LexerException("Warning at " + line + ":" + column + ": " + msg); }
protected void warning(int line, int column, String msg) throws LexerException { if (werror) error(line, column, msg); else if (listener != null) listener.handleWarning(this, line, column, msg); else throw new LexerException("Warning at " + line + ":" + column + ": " + msg); }
@Override public void handleWarning( final Source source, final int line, final int column, final String msg) throws LexerException { try { this.on_warning.onWarning(source.getPath(), line, column, msg); } catch (final SoShaderException e) { throw new LexerException(e); } }