private String getNextToken(TokenStream stream) {
        String next = stream.next();
        if (next == null)
            throw new ParseException("End of stream while reading token.");
        // System.out.println("Parsed token \"" + next + "\"");
        return next;
    }