class LocationTokens {

    public String parseSummary() {
        Deque<String> stack = new ArrayDeque<>();
        for (Chunk chunk : chunks) {
            StringBuffer chunkBuffer = new StringBuffer();
            chunkBuffer.append(chunk.getType());
            chunkBuffer.append("{ ");
            for (Iterator<Token> iter = chunk.getTokens().iterator(); iter.hasNext();) {
                Token token = iter.next();
                chunkBuffer.append(String.format("%s[%s]", token.getType(), token.getValue()));
                if (iter.hasNext()) {
                    chunkBuffer.append(", ");
                }
            }
            chunkBuffer.append(" }");
            stack.push(chunkBuffer.toString());
        }
        StringBuffer buff = new StringBuffer();
        for (Iterator<String> iter = stack.iterator(); iter.hasNext();) {
            buff.append(iter.next());
            if (iter.hasNext()) {
                buff.append(", ");
            }
        }
        return String.format("%s", buff.toString());
    }

    public  LocationTokens(Input input, List<Chunk> chunks);

}