In Berlin everything’s about *wurst\x00

EDIT: Nope, the title is not related to Kaminsky’s 26C3 talk. If it was so, the title would have been something like *\x00wurst ;-)

So, I just got back from Berlin where I attended the 26C3 which was a great success. All of us were there: argp, huku, solidsnk, brat, xorl, ithilgore, sin and gorlist. We drank beers and we had some fun and interesting talks together. Personally speaking, I enjoyed FX’s talk and the Phenoelit party the most :-)

It’s now time to get back to business and studying. During my time off, I managed to finish the LR state generation code for libast (Abstract Syntax Tree library). Libast, which is still under development, is responsible for parsing the input stream according to a BNF grammar given in libbnf’s format. So far, about 80% of libast is complete and works like charm. For debugging purposes, libast comes with Graphviz visualization support. For example, here’s how libast visualizes the traditional Dragon book expression grammar. The output produced by OpenSAT is here (executed via valgrind). The idea of visualizing the states belongs to guerrilla (yeah this guy rocks, he uses formal parsing methods to parse ASM code!).

So, back to hardcore studying since I am taking exams in about one month. In the meantime, during my free time, I’ll be finishing my byacc source code analysis and I’ll be checking gcc’s libcpp (I am planning to modify it and insert it in the OpenSAT source tree). Another idea that I came up with, is the use of Python-based semantics in Syntax Directed Translation schemes e.g. consider a standard byacc input file with the difference that the grammar semantics within { and } are written in Python. So, upon reducing the input according to a grammar rule, the semantic action is passed to the Python interpreter for execution. If you have some experience in that please contact me, I’d really like to know if this works fine in real life applications!

– dp

2 Responses to “In Berlin everything’s about *wurst\x00”

  1. welcome back sir

  2. Instead of looking into Dragon Book’s version of Syntax Directed Translation, I suggest that you should look at attribute grammars because the semantics are completely defined (unlike SDD) while providing exactly the same facility (if not more). I think you could learn a lot from the mathematical models. Specifically “extended attribute grammars” which provide a semantics and syntax similar to BNF.
    I’ve been thinking about writing a post introducing formal attribute grammars but haven’t got around to it yet. We’ll see.

Leave a Reply