So, RCC is my attempt to write an LR compiler compiler. I’m doing a consumer-oriented database system and I need several languages to control the system. Last June (2007), I had a look around for an existing tool I could use, and wasn’t happy with the options. My requirements were fairly simple:
Anyway, after several frustrating days with existing systems, I decided to write my own. I figured it would take at most a month, and that I could live with that investment. So, naturally, it’s seven months later and I’m about ready to release it.
D’oh!
Of course, RCC (short for Ruby Compiler Compiler — hey, I poured all my creativity into the code
) has grown a bit since I started it. It now generates your lexer and AST, as well as the parser, and includes facilities to do simple AST transformations during construction (to reduce the amount of stuff you have to do to it after). The system also includes a grammar interpreter that explains exactly how your grammar deals with a particular source file, and why. This should make debugging grammars a lot easier.
Finally, the biggest feature (it sure as hell took the most time!) is the error recovery system, which attempts to figure out what the programmer had intended to type whenever an error is encountered, so error messages more reliably direct the user to the real problem.
In terms of status, I’m presently working on a pre-release refactoring of the RCC code base. The biggest aspect of this is a redesign of the grammar description language, which used to look a bit like yacc, and doesn’t any more (some of the assumptions I started with are no longer helpful). During development, the grammar was loaded by an ad hoc parser I wrote for the purpose. It was rather ugly, and didn’t produce the friendliest of error messages. The new grammar is being parsed by RCC’s grammar interpreter, so you get all the benefits of the error recovery and automated help systems. Yay!
More soon . . . .
| in Announcements: | « (none) |
| on site: |
« (none)
|
Markdown: The kinds of formatting markup you'd use in an email will probably work here. For more details on what you can do, check out the Markdown docs.