Home
Bluejack - March 7th, 2009

> Recent Entries
> Archive
> Friends
> User Info

Advertisement

March 7th, 2009


08:34 pm - Beware. Extra geeky.
I really should have separate blogs for separate subjects, I think. This is totally unrelated to anything most people who occasionally read this blog have any interest in, I'm sure.

But I need to vent.

I have a hunch that there's a single, evil mind behind three of the most venerable tools in the GNU family: Make, Flex, and Bison. (Curse you, Richard Stallman!) Certainly, all three of them share this in common:

* They have lots of documentation, none of which ever answers the question you're trying to find.
* They require the brain to think non-linearly, and to make non-obvious leaps of faith.

Since these are programming tools we're talking about, you will need to make a lot of non-obvious leaps of faith that result in very obvious thumps on the ground before you finally happen upon the correct answer.

In particular, I am currently trying to build something using Flex and Bison (AKA, lex and yacc), which involves using the "start condition" feature. These are poorly explained in the documentation, and do not provide get-you-going examples. Worst of all, the examples they do provide do not demonstrate the correct mechanism for marrying Flex, Bison, and start conditions.

So, I spent three hours attempting to figure out how to parse and pass a quoted string containing escape characters from flex to bison.

By the time I got it figured out, I had resorted to all sorts of hideous global variables to maintain state across multiple regular expression matches within the various rules of the start condition.

Lex and yacc are widely regarded as the tools to use when writing a compiler, but they feel like the kind of gruesomely hackish software a junior high school student might use to throw together a tetris demo. Obviously, a fiendishly clever kid, but I'm afraid we just can't give you more than a C, for this one. Maybe a C++.

(6 comments | Leave a comment)


Previous Day [Archive] Next Day

> Go to Top
LiveJournal.com