private void unread(int c) throws IOException { /* XXX Must unread newlines. */ if (c != -1) { if (isLineSeparator(c)) { line--; column = lastcolumn; cr = false; } else { column--; } switch (ucount) { case 0: u0 = c; ucount = 1; break; case 1: u1 = c; ucount = 2; break; default: throw new IllegalStateException( "Cannot unget another character!" ); } // reader.unread(c); } }
private void unread(int c) throws IOException { /* XXX Must unread newlines. */ if (c != -1) { if (isLineSeparator(c)) { line--; column = lastcolumn; cr = false; } else { column--; } switch (ucount) { case 0: u0 = c; ucount = 1; break; case 1: u1 = c; ucount = 2; break; default: throw new IllegalStateException( "Cannot unget another character!" ); } // reader.unread(c); } }
private void unread(int c) throws IOException { /* XXX Must unread newlines. */ if (c != -1) { if (isLineSeparator(c)) { line--; column = lastcolumn; cr = false; } else { column--; } switch (ucount) { case 0: u0 = c; ucount = 1; break; case 1: u1 = c; ucount = 2; break; default: throw new IllegalStateException( "Cannot unget another character!" ); } // reader.unread(c); } }
private Token whitespace(int c) throws IOException, LexerException { StringBuilder text = new StringBuilder(); int d; text.append((char)c); for (;;) { d = read(); if (ppvalid && isLineSeparator(d)) /* XXX Ugly. */ break; if (Character.isWhitespace(d)) text.append((char)d); else break; } unread(d); return new Token(WHITESPACE, text.toString()); }
@Nonnull private Token whitespace(int c) throws IOException, LexerException { StringBuilder text = new StringBuilder(); int d; text.append((char) c); for (;;) { d = read(); if (ppvalid && isLineSeparator(d)) /* XXX Ugly. */ break; if (Character.isWhitespace(d)) text.append((char) d); else break; } unread(d); return new Token(WHITESPACE, text.toString()); }
private Token cppcomment() throws IOException, LexerException { StringBuilder text = new StringBuilder("//"); int d = read(); while (!isLineSeparator(d)) { text.append((char)d); d = read(); } unread(d); return new Token(CPPCOMMENT, text.toString()); }
@Nonnull private Token cppcomment() throws IOException, LexerException { StringBuilder text = new StringBuilder("//"); int d = read(); while (!isLineSeparator(d)) { text.append((char) d); d = read(); } unread(d); return new Token(CPPCOMMENT, text.toString()); }
private Token whitespace(int c) throws IOException, LexerException { StringBuilder text = new StringBuilder(); int d; text.append((char)c); for (;;) { d = read(); if (ppvalid && isLineSeparator(d)) /* XXX Ugly. */ break; if (Character.isWhitespace(d)) text.append((char)d); else break; } unread(d); return new Token(WHITESPACE, text.toString()); }
@Nonnull private Token invalid(StringBuilder text, String reason) throws IOException, LexerException { int d = read(); while (!isLineSeparator(d)) { text.append((char) d); d = read(); } unread(d); return new Token(INVALID, text.toString(), reason); }
private Token cppcomment() throws IOException, LexerException { StringBuilder text = new StringBuilder("//"); int d = read(); while (!isLineSeparator(d)) { text.append((char)d); d = read(); } unread(d); return new Token(CPPCOMMENT, text.toString()); }
private Token invalid(StringBuilder text, String reason) throws IOException, LexerException { int d = read(); while (!isLineSeparator(d)) { text.append((char)d); d = read(); } unread(d); return new Token(INVALID, text.toString(), reason); }
private Token invalid(StringBuilder text, String reason) throws IOException, LexerException { int d = read(); while (!isLineSeparator(d)) { text.append((char)d); d = read(); } unread(d); return new Token(INVALID, text.toString(), reason); }
"End of file in string literal after " + buf); else if (isLineSeparator(c)) { unread(c);
"End of file in string literal after " + buf); else if (isLineSeparator(c)) { unread(c);
} else if (isLineSeparator(c)) { unread(c);
d = escape(text); else if (isLineSeparator(d)) { unread(d); return new Token(INVALID, text.toString(), if (isLineSeparator(e)) { unread(e); break;
text.append('\\'); d = escape(text); } else if (isLineSeparator(d)) { unread(d); return new Token(INVALID, text.toString(), if (isLineSeparator(e)) { unread(e); break;
d = escape(text); else if (isLineSeparator(d)) { unread(d); return new Token(INVALID, text.toString(), if (isLineSeparator(e)) { unread(e); break;