Here is a Python code snippet.
indentCount = 0 textChars = [] suffixChars = [] # convert the line into a list of characters # and feed the list to the ReadAhead generator chars = ReadAhead(list(line)) c = chars.next() # get first while c and c == INDENT_CHAR: # process indent characters indentCount += 1 c = chars.next() while c and c != SYMBOL: # process text characters textChars.append(c) c = chars.next() if c and c == SYMBOL: c = chars.next() # read past the SYMBOL while c: # process suffix characters suffixChars.append(c) c = chars.next()