3 ms·
I have used yacc and its offspring like bison for a long time. Writing the grammars is really simple, but debugging them is really arcane. The problem is that
by russell 16y ago
I have used yacc and its offspring like bison for a long time. Writing the grammars is really simple, but debugging them is really arcane. The problem is that the place where the parser generator discovers the error can be some distance from where you introduced the ambiguity. Grammars have their own debugging style, particularly with yacc/bison output. Eventually you have an aha moment and you start looking for an improper empty state or trying a reduction at the wrong place in the parse tree. It isnt hard if you grasp it and probably an intractable bitch if you dont.
I will agree however, that the parser and the bison source look like someone barfed C all over the floor, unless someone has given it serious TLC in the past dozen years.