hi, I was looking at some of the visual parser generator tools today - I discovered Anagram (http://www.parsifalsoft.com), and Visual Parse ++ (http://sand-stone.com) . These tools can generate LALR parsers like Bison but also come with a nice visual interface to single step through parses. You compose and debug grammars through an IDE. Unfortunately both programs are non-free.
I am considering the possibility of building a free IDE for Bison with at least the following abilities : 1. Single step through a test input file and obtain a trace (like the one produced by a %debug directive. But now it will break after each step and wait for user input) 2. Alter input before proceeding to the next step. 3. Set breakpoints in the input and parse until break point is reached. 4. Watch the stack, current state, look-aheads at each state. There are many more possibilities - for example, you can watch a GLR parser split and merge as you single step; Also, an editor could be provided to compose grammars with syntax highlighting (And indication of conflicts as you compose); I am facing two alternatives to implement this idea: 1. Take the current release of Bison, and build on its source code to produce a visual IDE. 2. Implement a debugging interface in bison that can talk to such IDE /debugging tools. This interface can then evolve with Bison; The second approach appeals to me since many tools can be built with varying capabilities (e.g, ncurses based tool or a simple command line tool like gdb or a full fledged IDE with GTK+ etc.) ; Also, changes in Bison can be easily reflected in the tool (keeping a clean separation between Bison and the IDE tool); Also there are a number of challenges in building such an IDE. For a start, we cant execute semantic actions while test-parsing; How would we simulate cases where the lexer needs to examine the symbol table for supplying tokens ? (possible answer: we don't). Please comment upon this idea. I want to know your opinion on the correct way to do this. Thanks! By the way, I have some documentation on Bison internals on http://bison-internals.blogspot.com I am still midway through it. If you think I have documented something incorrectly, pls drop a line. Thanks! ./satya.
