public Token next() {
        int tokenType;
        try {
            tokenType = tokenizer.nextToken();

            switch (tokenType) {
                case StreamTokenizer.TT_WORD:
                        if (member(tokenizer.sval, keywords)) {
                            lastToken = new Token(TokenType.KEYWORD, tokenizer.sval);
                        } else {
                            lastToken = new Token(TokenType.NAME, tokenizer.sval);
                        }
                        break;
                case '"':
                    lastToken = new Token(TokenType.STRING, tokenizer.sval);
                    break;
                
                case StreamTokenizer.TT_NUMBER:
                    lastToken = new Token(TokenType.NUMBER, tokenizer.nval + "");
                    break;

                case StreamTokenizer.TT_EOL:
                    lastToken = EOL;
                    break;

                case StreamTokenizer.TT_EOF:
                    lastToken = EOI;
                    break;
                default:
                    lastToken = new Token(TokenType.SYMBOL, "" + (char) tokenType);
                    break;
            }
        }
        catch (IOException e) {
            lastToken = new Token(TokenType.ERROR, e.getMessage());
        }
        return lastToken;
    }