private Token ccomment() throws IOException, LexerException { StringBuilder text = new StringBuilder("/*"); int d; do { do { d = read(); text.append((char)d); } while (d != '*'); do { d = read(); text.append((char)d); } while (d == '*'); } while (d != '/'); return new Token(CCOMMENT, text.toString()); }
private Token number_decimal(int c) throws IOException, LexerException { StringBuilder text = new StringBuilder((char)c); int d = c; long val = 0; do { val = val * 10 + Character.digit(d, 10); text.append((char)d); d = read(); } while (Character.digit(d, 10) != -1); return _number(text, val, d); }
private Token ccomment() throws IOException, LexerException { StringBuilder text = new StringBuilder("/*"); int d; do { do { d = read(); text.append((char)d); } while (d != '*'); do { d = read(); text.append((char)d); } while (d == '*'); } while (d != '/'); return new Token(CCOMMENT, text.toString()); }
private Token number_decimal(int c) throws IOException, LexerException { StringBuilder text = new StringBuilder((char)c); int d = c; long val = 0; do { val = val * 10 + Character.digit(d, 10); text.append((char)d); d = read(); } while (Character.digit(d, 10) != -1); return _number(text, val, d); }
private Token identifier(int c) throws IOException, LexerException { StringBuilder text = new StringBuilder(); int d; text.append((char)c); for (;;) { d = read(); if (Character.isIdentifierIgnorable(d)) ; else if (Character.isJavaIdentifierPart(d)) text.append((char)d); else break; } unread(d); return new Token(IDENTIFIER, text.toString()); }
@Nonnull private Token identifier(int c) throws IOException, LexerException { StringBuilder text = new StringBuilder(); int d; text.append((char) c); for (;;) { d = read(); if (Character.isIdentifierIgnorable(d)) ; else if (Character.isJavaIdentifierPart(d)) text.append((char) d); else break; } unread(d); return new Token(IDENTIFIER, 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()); }
private Token identifier(int c) throws IOException, LexerException { StringBuilder text = new StringBuilder(); int d; text.append((char)c); for (;;) { d = read(); if (Character.isIdentifierIgnorable(d)) ; else if (Character.isJavaIdentifierPart(d)) text.append((char)d); else break; } unread(d); return new Token(IDENTIFIER, 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 cond(char c, int yes, int no) throws IOException, LexerException { int d = read(); if (c == d) return new Token(yes); unread(d); return new Token(no); }
private Token cond(char c, int yes, int no) throws IOException, LexerException { int d = read(); if (c == d) return new Token(yes); unread(d); return new Token(no); }
private Token cond(char c, int yes, int no) throws IOException, LexerException { int d = read(); if (c == d) return new Token(yes); unread(d); return new Token(no); }