/** * Handles a warning. * * If a PreprocessorListener is installed, it receives the * warning. Otherwise, an exception is thrown. * * @see #warning(int, int, String) */ protected void warning(@Nonnull Token tok, @Nonnull String msg) throws LexerException { warning(tok.getLine(), tok.getColumn(), msg); }
/** * Handles an error. * * If a PreprocessorListener is installed, it receives the * error. Otherwise, an exception is thrown. * * @see #error(int, int, String) */ protected void error(@Nonnull Token tok, @Nonnull String msg) throws LexerException { error(tok.getLine(), tok.getColumn(), msg); }
private Token stringify(Token pos, Argument arg) { StringBuilder buf = new StringBuilder(); concat(buf, arg); // System.out.println("Concat: " + arg + " -> " + buf); StringBuilder str = new StringBuilder("\""); escape(str, buf); str.append("\""); // System.out.println("Escape: " + buf + " -> " + str); return new Token(STRING, pos.getLine(), pos.getColumn(), str.toString(), buf.toString()); }
@Nonnull private Token stringify(@Nonnull Token pos, @Nonnull Argument arg) { StringBuilder buf = new StringBuilder(); concat(buf, arg); // System.out.println("Concat: " + arg + " -> " + buf); StringBuilder str = new StringBuilder("\""); escape(str, buf); str.append("\""); // System.out.println("Escape: " + buf + " -> " + str); return new Token(STRING, pos.getLine(), pos.getColumn(), str.toString(), buf.toString()); }
private Token stringify(Token pos, Argument arg) { StringBuilder buf = new StringBuilder(); concat(buf, arg); // System.out.println("Concat: " + arg + " -> " + buf); StringBuilder str = new StringBuilder("\""); escape(str, buf); str.append("\""); // System.out.println("Escape: " + buf + " -> " + str); return new Token(STRING, pos.getLine(), pos.getColumn(), str.toString(), buf.toString()); }
/** * Handles an error. * * If a PreprocessorListener is installed, it receives the * error. Otherwise, an exception is thrown. * * @see #error(int, int, String) */ protected void error(Token tok, String msg) throws LexerException { error(tok.getLine(), tok.getColumn(), msg); }
/** * Handles a warning. * * If a PreprocessorListener is installed, it receives the * warning. Otherwise, an exception is thrown. * * @see #warning(int, int, String) */ protected void warning(Token tok, String msg) throws LexerException { warning(tok.getLine(), tok.getColumn(), msg); }
/** * Handles an error. * * If a PreprocessorListener is installed, it receives the * error. Otherwise, an exception is thrown. * * @see #error(int, int, String) */ protected void error(Token tok, String msg) throws LexerException { error(tok.getLine(), tok.getColumn(), msg); }
/** * Handles a warning. * * If a PreprocessorListener is installed, it receives the * warning. Otherwise, an exception is thrown. * * @see #warning(int, int, String) */ protected void warning(Token tok, String msg) throws LexerException { warning(tok.getLine(), tok.getColumn(), msg); }
Arrays.fill(cbuf, '\n'); return new Token(WHITESPACE, tok.getLine(), tok.getColumn(), new String(cbuf));
Arrays.fill(cbuf, '\n'); return new Token(WHITESPACE, tok.getLine(), tok.getColumn(), new String(cbuf));
Arrays.fill(cbuf, '\n'); return new Token(WHITESPACE, tok.getLine(), tok.getColumn(), new String(cbuf));
if (!tokens.hasNext()) { error(ptok.getLine(), ptok.getColumn(), "Paste at end of expansion"); buf.append(' ').append(ptok.getText());
if (!tokens.hasNext()) { error(ptok.getLine(), ptok.getColumn(), "Paste at end of expansion"); buf.append(' ').append(ptok.getText());