introduction to parsing this is the easiest of the parsing functions it simply adds new row as the last child of the stack of block' top blockand advances over the new row character this completes the review of the blocks recursive descent parser the parser does not require huge amount of codefewer than linesbut that' still more than percent more lines than the pyparsing version needsand about percent more lines than the ply version needs and as we will seeusing pyparsing or ply is much easier than handcrafting recursive descent parser--and they also lead to parsers that are much easier to maintain the conversion into an svg file using the blockoutput save_blocks_as_svg(function is the same for all the blocks parserssince they all produce the same root block and children structures we won' review the function' code since it isn' relevant to parsing as such--it is in the blockoutput py module file that comes with the book' examples we have now finished reviewing the handcrafted parsers in the following two sections we will show pyparsing and ply versions of these parsers in additionwe will show parser for dsl that would need quite sophisticated recursive descent parser if we did it by handand that really shows that as our needs growusing generic parser scales much better than handcrafted solution pythonic parsing with pyparsing ||writing recursive descent parsers by hand can be quite tricky to get rightand if we need to create many parsers it can soon become tedious both to write them and especially to maintain them one obvious solution is to use generic parsing moduleand those experienced with bnfs or with the unix lex and yacc tools will naturally gravitate to similar tools in the section following this one we cover ply (python lex yacc) tool that exemplifies this classic approach but in this section we will look at very different kind of parsing toolpyparsing pyparsing is described by its authorpaul mcguireas "an alternative approach to creating and executing simple grammarsvs the traditional lex/yacc approachor the use of regular expressions(although in factregexes can be used with pyparsing for those used to the traditional approachpyparsing requires some reorientation in thinking the payback is the ability to develop parsers that do not require lot of code--thanks to pyparsing providing many high-level elements that can match common constructs--and which are easy to understand and maintain pyparsing is available under an open source license and can be used in both noncommercial and commercial contexts howeverpyparsing is not