private int readIdentifier(int c, Token token) {
        StringBuffer tbuf = textBuffer;
        tbuf.setLength(0);

        do {
            tbuf.append((char)c);
            c = getc();
        } while (Character.isJavaIdentifierPart((char)c));

        ungetc(c);

        String name = tbuf.toString();
        int t = ktable.lookup(name);
        if (t >= 0)
            return t;
        else {
            /* tbuf.toString() is executed quickly since it does not
             * need memory copy.  Using a hand-written extensible
             * byte-array class instead of StringBuffer is not a good idea
             * for execution speed.  Converting a byte array to a String
             * object is very slow.  Using an extensible char array
             * might be OK.
             */
            token.textValue = name;
            return Identifier;
        }
    }