Integrating Coco/R into VS2005
One of the Cons about Coco/R is it’s lack of integration into the VS2005 IDE. Yes, I know that a plugin for #develop exists but I do not want to switch IDE (sorry, but VS2005 is far better).
For my purposes, a complete integration would consist of the following steps:
- Attach PxCoco (the parser generator) to the Build button in VS2005.
- Forward errors from PxCoco to VS2005.
- Support multi-file grammars with proper error forwarding.
- Map C# errors in the resulting parser class to the grammar file.
- Provide intellisense (and all the other wonderful features in VS2005) for grammar files.
As of now I have done steps 1-3 and am planning to implement number 4. It would be really cool to have Coco/R grammar as a first class language in VS2005 but that would mean writing a complete language plugin for VS2005 that supports both, the grammar notation and C#, from scratch.
I’m thinking about releasing PxCoco or telling the authors of Coco/R about my extensions. But not before I got my damn prototype (Yes, I want to show off…
).
I have taken a screenshot. Look at the underlined variable name in the grammar definition, the list of warnings in the error tab and the corresponding grammar fragments in the project explorer.
Update (02/09/2007):
I just found out, that someone already wrote a VS add-in for Coco/R. Unfortunately this comes a bit too late for my Project as I have split up my grammer into multiple files and, as we all know, custom tools can only process a single file.
My implementation has some bugs: Due to the fact that I have to translate line numbers twice (grammar fragments > single grammar file > generated parser) I sometimes get the line numbers wrong… After countless debug sessions I finally decided to focus on my actual project, Prexonite.
My current solution is a mixture of custom MSBuild tasks and a hacked version of Coco/R.
Hey,
this is real good work ur doing. dont stop. Coco/R is a gr8 tool and this will really make more people use it.
Thanks,
unfortunately my actual project has higher priority.
You may want to have a look at: http://www.codeproject.com/useritems/vsCoco.asp