<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Coco/R plugin for Visual Studio</title>
	<atom:link href="http://einaregilsson.com/cocor-plugin-for-visual-studio/feed/" rel="self" type="application/rss+xml" />
	<link>http://einaregilsson.com/cocor-plugin-for-visual-studio/</link>
	<description>A site for my programming pet projects</description>
	<lastBuildDate>Mon, 23 Jan 2012 07:51:01 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: tads</title>
		<link>http://einaregilsson.com/cocor-plugin-for-visual-studio/comment-page-1/#comment-75909</link>
		<dc:creator>tads</dc:creator>
		<pubDate>Sat, 24 Dec 2011 10:55:24 +0000</pubDate>
		<guid isPermaLink="false">http://tech.einaregilsson.com/?p=219#comment-75909</guid>
		<description>Thanks. You saved my life...i had to browse throught google and found many but little use to me.But your&#039;s really was a solution for me.

THANKS ONCE MORe!</description>
		<content:encoded><![CDATA[<p>Thanks. You saved my life&#8230;i had to browse throught google and found many but little use to me.But your&#8217;s really was a solution for me.</p>
<p>THANKS ONCE MORe!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: einar</title>
		<link>http://einaregilsson.com/cocor-plugin-for-visual-studio/comment-page-1/#comment-71057</link>
		<dc:creator>einar</dc:creator>
		<pubDate>Thu, 08 Apr 2010 15:19:50 +0000</pubDate>
		<guid isPermaLink="false">http://tech.einaregilsson.com/?p=219#comment-71057</guid>
		<description>Hi

Well, first of all Coco itself is not really my work, so I don&#039;t know all the thinking behind it. But as for my opinion, I don&#039;t really understand the problem you&#039;re having:

1. Several applications for one grammar. What are these applications doing? Why don&#039;t you parse your input into an abstract syntax tree (or some other datastructure) and then let your applications work on that datastructure? What kind of application code are you talking about?

2. Dotted identifiers and dots inside strings. Are you talking standard quoted strings here, e.g. &quot;hello. World&quot;? If so, that string is one token, so the fact that there is a token inside it doesn&#039;t matter.

But in general, yes, I could see where state could become an issue for example parsing a php file where on one hand you have everything inside &lt;? ?&gt; which has its own token rules but on the other hand you&#039;re parsing the html outside those tokens.</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>Well, first of all Coco itself is not really my work, so I don&#8217;t know all the thinking behind it. But as for my opinion, I don&#8217;t really understand the problem you&#8217;re having:</p>
<p>1. Several applications for one grammar. What are these applications doing? Why don&#8217;t you parse your input into an abstract syntax tree (or some other datastructure) and then let your applications work on that datastructure? What kind of application code are you talking about?</p>
<p>2. Dotted identifiers and dots inside strings. Are you talking standard quoted strings here, e.g. &#8220;hello. World&#8221;? If so, that string is one token, so the fact that there is a token inside it doesn&#8217;t matter.</p>
<p>But in general, yes, I could see where state could become an issue for example parsing a php file where on one hand you have everything inside &lt;? ?&gt; which has its own token rules but on the other hand you&#8217;re parsing the html outside those tokens.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jochen</title>
		<link>http://einaregilsson.com/cocor-plugin-for-visual-studio/comment-page-1/#comment-71055</link>
		<dc:creator>jochen</dc:creator>
		<pubDate>Thu, 08 Apr 2010 10:06:46 +0000</pubDate>
		<guid isPermaLink="false">http://tech.einaregilsson.com/?p=219#comment-71055</guid>
		<description>A bit late...but...

I used Coco and the plugin a bit more, but am now close to stop using it. The plugin is fine, but what I was sceptical of ever since, is that since the establishment of lex like tool chains, people write their application code into the grammar files. Studying the .ATG samples for the C# parser a bit more, revealed to me, that it also contains a hand written scanner.
And this is exactly what ails me in my project: I have /several/ applications for the same grammar, not just one, so mixing application and grammar is a bit of a no no for me.
Also, the standard scanner is a single state automaton, which makes it harder to get useful semantic actions attached.
Theory says, not without reason, that a scanner is a FSM (Finite state machine), as it needs to be context sensitive as to the state of the parser. 
Example:
You have doted identifiers (e.g. namespaces) and you have strings, which might contain dots. The naive approach would be cumbersome, as the Scanner would split the string within the &quot;&quot; delimiters, as there is also the dot token, the scanner recognizes.
I tend more and more to return to my traditional way of tackling my task, using the parser composition approach (see boost/spirit for the idea, while I do it in simpler style in C#). With that, there is no factored out scanner and the state of the parser naturally is coupled to the way, the scanner operates. 
I know, this is probably not the right forum, but I would be interested in a discussion about the question, as to whether a seperated scanner is truly a good idea.</description>
		<content:encoded><![CDATA[<p>A bit late&#8230;but&#8230;</p>
<p>I used Coco and the plugin a bit more, but am now close to stop using it. The plugin is fine, but what I was sceptical of ever since, is that since the establishment of lex like tool chains, people write their application code into the grammar files. Studying the .ATG samples for the C# parser a bit more, revealed to me, that it also contains a hand written scanner.<br />
And this is exactly what ails me in my project: I have /several/ applications for the same grammar, not just one, so mixing application and grammar is a bit of a no no for me.<br />
Also, the standard scanner is a single state automaton, which makes it harder to get useful semantic actions attached.<br />
Theory says, not without reason, that a scanner is a FSM (Finite state machine), as it needs to be context sensitive as to the state of the parser.<br />
Example:<br />
You have doted identifiers (e.g. namespaces) and you have strings, which might contain dots. The naive approach would be cumbersome, as the Scanner would split the string within the &#8220;&#8221; delimiters, as there is also the dot token, the scanner recognizes.<br />
I tend more and more to return to my traditional way of tackling my task, using the parser composition approach (see boost/spirit for the idea, while I do it in simpler style in C#). With that, there is no factored out scanner and the state of the parser naturally is coupled to the way, the scanner operates.<br />
I know, this is probably not the right forum, but I would be interested in a discussion about the question, as to whether a seperated scanner is truly a good idea.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: einar</title>
		<link>http://einaregilsson.com/cocor-plugin-for-visual-studio/comment-page-1/#comment-71034</link>
		<dc:creator>einar</dc:creator>
		<pubDate>Tue, 23 Mar 2010 07:50:59 +0000</pubDate>
		<guid isPermaLink="false">http://tech.einaregilsson.com/?p=219#comment-71034</guid>
		<description>Well, it sounds interesting. I don&#039;t really have time to work on this now, but feel free to download the code and try modifying it. If you do, let me know how it works out :)</description>
		<content:encoded><![CDATA[<p>Well, it sounds interesting. I don&#8217;t really have time to work on this now, but feel free to download the code and try modifying it. If you do, let me know how it works out <img src='http://einaregilsson.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jochen</title>
		<link>http://einaregilsson.com/cocor-plugin-for-visual-studio/comment-page-1/#comment-71033</link>
		<dc:creator>jochen</dc:creator>
		<pubDate>Mon, 22 Mar 2010 22:39:25 +0000</pubDate>
		<guid isPermaLink="false">http://tech.einaregilsson.com/?p=219#comment-71033</guid>
		<description>Yes, the hooks could be created automatically, so the .atg file only contains the grammar, but no C# code at all.
The idea is, that partial functions not implemented are automatically removed by the compiler. And thus, there is no performance hit coming with &quot;too many&quot; of them.
The usual procedure would be to manually declare a set of partial functions in the upper part of the .atg file and then
to add (. MyPartialFunction(...); .) at the corresponding spots.
This is still too much work for a lazy person such as me ;)
Instead, the idea of the boost/spirit parser could be applied, such that semantic actions are generated as partial functions automatically, maybe along the scheme:

SomeProduction
 =  (. SomeProductionBegin(); .)
     // more &quot;hooks&quot; at each position where a match happens, (so data can be extracted).
    (. SomeProductionEnd(); .)
 .

Users would then simply implement the partial functions they are interested in in a third .cs partial class part.</description>
		<content:encoded><![CDATA[<p>Yes, the hooks could be created automatically, so the .atg file only contains the grammar, but no C# code at all.<br />
The idea is, that partial functions not implemented are automatically removed by the compiler. And thus, there is no performance hit coming with &#8220;too many&#8221; of them.<br />
The usual procedure would be to manually declare a set of partial functions in the upper part of the .atg file and then<br />
to add (. MyPartialFunction(&#8230;); .) at the corresponding spots.<br />
This is still too much work for a lazy person such as me <img src='http://einaregilsson.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
Instead, the idea of the boost/spirit parser could be applied, such that semantic actions are generated as partial functions automatically, maybe along the scheme:</p>
<p>SomeProduction<br />
 =  (. SomeProductionBegin(); .)<br />
     // more &#8220;hooks&#8221; at each position where a match happens, (so data can be extracted).<br />
    (. SomeProductionEnd(); .)<br />
 .</p>
<p>Users would then simply implement the partial functions they are interested in in a third .cs partial class part.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: einar</title>
		<link>http://einaregilsson.com/cocor-plugin-for-visual-studio/comment-page-1/#comment-71032</link>
		<dc:creator>einar</dc:creator>
		<pubDate>Mon, 22 Mar 2010 18:58:00 +0000</pubDate>
		<guid isPermaLink="false">http://tech.einaregilsson.com/?p=219#comment-71032</guid>
		<description>Hi Jochen

Do you have particular hooks in mind that you think would be useful here?

There is also now an &quot;official&quot; Coco/R plugin for VS (at least made at the same institute that makes Coco/R), however I don&#039;t know exactly what approach they take as I&#039;ve never tried it.</description>
		<content:encoded><![CDATA[<p>Hi Jochen</p>
<p>Do you have particular hooks in mind that you think would be useful here?</p>
<p>There is also now an &#8220;official&#8221; Coco/R plugin for VS (at least made at the same institute that makes Coco/R), however I don&#8217;t know exactly what approach they take as I&#8217;ve never tried it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jochen</title>
		<link>http://einaregilsson.com/cocor-plugin-for-visual-studio/comment-page-1/#comment-71031</link>
		<dc:creator>jochen</dc:creator>
		<pubDate>Mon, 22 Mar 2010 15:29:56 +0000</pubDate>
		<guid isPermaLink="false">http://tech.einaregilsson.com/?p=219#comment-71031</guid>
		<description>Good work!

Is it only me? The partial classes approach is great and as it should be done!
But...would it not be better to declare partial &quot;hook&quot; functions in the generated code files as well, as well as calling them in the appropriate spots during parsing, so a (third?) partial file could contain the implementations, such that regenerating does not affect the hand written code?</description>
		<content:encoded><![CDATA[<p>Good work!</p>
<p>Is it only me? The partial classes approach is great and as it should be done!<br />
But&#8230;would it not be better to declare partial &#8220;hook&#8221; functions in the generated code files as well, as well as calling them in the appropriate spots during parsing, so a (third?) partial file could contain the implementations, such that regenerating does not affect the hand written code?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pavel K</title>
		<link>http://einaregilsson.com/cocor-plugin-for-visual-studio/comment-page-1/#comment-67651</link>
		<dc:creator>Pavel K</dc:creator>
		<pubDate>Tue, 12 May 2009 17:21:44 +0000</pubDate>
		<guid isPermaLink="false">http://tech.einaregilsson.com/?p=219#comment-67651</guid>
		<description>Hi,
thanks. I changed it, recompiled it and have been using it for a few day. 
Great tool!! What a relief. All&#039;s changed just with hitting the save button.

Thanks again.
Pavel K.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
thanks. I changed it, recompiled it and have been using it for a few day.<br />
Great tool!! What a relief. All&#8217;s changed just with hitting the save button.</p>
<p>Thanks again.<br />
Pavel K.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: einar</title>
		<link>http://einaregilsson.com/cocor-plugin-for-visual-studio/comment-page-1/#comment-67600</link>
		<dc:creator>einar</dc:creator>
		<pubDate>Fri, 08 May 2009 09:49:48 +0000</pubDate>
		<guid isPermaLink="false">http://tech.einaregilsson.com/?p=219#comment-67600</guid>
		<description>Hi

Glad you could use the tool. Unfortunately you can&#039;t really change the frame file without re-compiling the plugin since the frame files are embedded in the CocoPlugin.dll file. Maybe not the best decision I made there...

But you can if you want check out the source from Subversion at http://einaregilsson.googlecode.com/svn/dotnet/CocoPlugin/

Then change the Scanner.frame file in the Frames folder and rebuild the .dll. You don&#039;t need to rebuild the installer or anything, just build the dll and dump it in &lt;my documents&gt;\Visual Studio 200X\AddIns or something like that, where the old CocoPlugin.dll is.

If that doesn&#039;t work for you for some reason then just let me know exactly how you want the line to read (&quot; = new Dictionary&lt;what, what&gt;&quot;) and I&#039;ll do a custom build for you.</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>Glad you could use the tool. Unfortunately you can&#8217;t really change the frame file without re-compiling the plugin since the frame files are embedded in the CocoPlugin.dll file. Maybe not the best decision I made there&#8230;</p>
<p>But you can if you want check out the source from Subversion at <a href="http://einaregilsson.googlecode.com/svn/dotnet/CocoPlugin/" rel="nofollow">http://einaregilsson.googlecode.com/svn/dotnet/CocoPlugin/</a></p>
<p>Then change the Scanner.frame file in the Frames folder and rebuild the .dll. You don&#8217;t need to rebuild the installer or anything, just build the dll and dump it in <my documents>\Visual Studio 200X\AddIns or something like that, where the old CocoPlugin.dll is.</p>
<p>If that doesn&#8217;t work for you for some reason then just let me know exactly how you want the line to read (&#8221; = new Dictionary<what , what>&#8220;) and I&#8217;ll do a custom build for you.</what></my></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pavel K</title>
		<link>http://einaregilsson.com/cocor-plugin-for-visual-studio/comment-page-1/#comment-67587</link>
		<dc:creator>Pavel K</dc:creator>
		<pubDate>Thu, 07 May 2009 10:20:26 +0000</pubDate>
		<guid isPermaLink="false">http://tech.einaregilsson.com/?p=219#comment-67587</guid>
		<description>Hi,
thanks a lot. Great tool.
Just a question: I am about to use coco/r with Silverlight which doesn&#039;t support Hashtable. I found that I should use System.Collections.Generic.Dictionary. I changed the definition of start in scanner.cs to static readonly Dictionary start. But when scanner.generated.cs is regenerated, there is still Hashtable there. 
Is there any flexible way of setting the underlying frame file and specifically this datatype?
Thanks a lot.
Pavel K.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
thanks a lot. Great tool.<br />
Just a question: I am about to use coco/r with Silverlight which doesn&#8217;t support Hashtable. I found that I should use System.Collections.Generic.Dictionary. I changed the definition of start in scanner.cs to static readonly Dictionary start. But when scanner.generated.cs is regenerated, there is still Hashtable there.<br />
Is there any flexible way of setting the underlying frame file and specifically this datatype?<br />
Thanks a lot.<br />
Pavel K.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

