At work at the moment I'm rewriting a parsing routine for a C codebase, which currently uses Lemon, a LALR(1) parser generator. Lemon's great for converting a grammar into a nice routine for your code to call, but I've found the grammar has quickly expanded to a near-unmaintainable state to cover all our use cases.
As part of an abandoned rewrite of the parser, I replaced the hand-coded tokenisation with the Flex lexical analyser, which I found I rather liked, even if its lack of Unicode support might leave me having to rewrite that part by hand at some point.
With Lemon out of the way, I realised that it might not be a bad idea to move prototyping my self-devised algorithms (later superceded by the rather nifty Shunting Yard algorithm) and processing code into Python rather than C to speed up development. However, Flex doesn't provide any Python bindings.
( Enter ctypes )
As part of an abandoned rewrite of the parser, I replaced the hand-coded tokenisation with the Flex lexical analyser, which I found I rather liked, even if its lack of Unicode support might leave me having to rewrite that part by hand at some point.
With Lemon out of the way, I realised that it might not be a bad idea to move prototyping my self-devised algorithms (later superceded by the rather nifty Shunting Yard algorithm) and processing code into Python rather than C to speed up development. However, Flex doesn't provide any Python bindings.
( Enter ctypes )