introduction to parsing we will begin by looking at the data classthen we will see how the class is used and the parsing startedand then we will review each parsing function as we encounter it class datadef __init__(selftext)self text text self pos self line self column self brackets self stack [block get_root_block()the data class holds the text of the file we are parsingthe position we are up to (self pos)and the ( -basedline and column this position represents it also keeps track of the brackets (adding one to the count for every open bracket and subtracting one for every close bracketthe stack is list of blocksinitialized with an empty root block at the end we will return the root block--if the parse was successful this block will have child blocks (which may have their own child blocksetc )representing the blocks data def location(self)return "line { }column { }format(self lineself columnthis is tiny convenience method to return the current location as string containing the line and column numbers def advance_by(selfamount)for in range(amount)self _advance_by_one(the parser needs to advance through the text as it parses for convenienceseveral advancing methods are providedthis one advances by the given number of characters def _advance_by_one(self)self pos + if (self pos len(self textand self text[self pos="\ ")self line + self column elseself column +