If input parameter i is None then a dictionary with NIML elements, or
a list containing such elements, is returned. If i is an integer,
then a tuple j, d is returned with d the new starting position and a
dictionary or list with the elements parsed so far.