I&#x27;ve looked at yacc + bison a couple times and always turned away before even attempting to write parsers in them. It&#x27;s ugly as hell and I figure sprinkling code is hard to understand and thus insecure.<p>However, have you tried parser combinators? Parsec (a Haskell library) is really nice if it fits your grammar.<p>Here is one guy who simulated that in Python, also very nice:<p><a href="http:&#x2F;&#x2F;jayconrod.com&#x2F;posts&#x2F;37&#x2F;" rel="nofollow">http:&#x2F;&#x2F;jayconrod.com&#x2F;posts&#x2F;37&#x2F;</a>