Einar Egilsson

Coco/R plugin for Visual Studio

Posted: Last updated:

I've blogged before about the excellent Coco/R parser generator. I'm using it a lot in my masters project and I'm happy with it but there were a few things I wished worked differently. The main thing was that I wanted better Visual Studio integration. I had set up a pre-build event that generated the parser and scanner before every build. However there is obviously no need to re-generate the files unless the grammar file has changed. Generating on every build also had the effect that Visual Studio kept prompting me about reloading changed files and I had to build to see if there were any errors in my grammar. So, I decided to create a Visual Studio plugin for Coco/R myself.

Coco/R is open source and written in C# (at least one version of it) so it was easy to get the source. I then looked at a couple of tutorials on Visual Studio plugins and managed to hack together an plugin that works well enough for my needs. I also made a small change to the way Coco/R generates its parsers and scanners from frame files. Here are the features that are unique to the plugin:

So, that's it. You can download an MSI installer for it and you can download the source. Enjoy.

If you read this far you should probably follow me on Twitter.