<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://www.codeplex.com/rss.xsl"?><rss version="2.0"><channel><title>irony Work Item Rss Feed</title><link>http://www.codeplex.com/irony/WorkItem/List.aspx</link><description>irony Work Item Rss Description</description><item><title>Commented Issue: Custom &amp; FreeTextLiteral Terminals are not sorted by priority [6291]</title><link>http://irony.codeplex.com/WorkItem/View.aspx?WorkItemId=6291</link><description>Hey Roman,&lt;br /&gt;&lt;br /&gt;First of all, I must say, great work&amp;#33;  I&amp;#39;ve been using Irony for a little over a month with awesome results, but I finally ran into this bug.&lt;br /&gt;&lt;br /&gt;I have two terminals, a CustomTerminal and a FreeTextLiteral.  It seems that the terminals are being sorted by token name rather than priority.  &amp;#40;They are stored in alphanumerically ascending order in Scanner&amp;#58;&amp;#58;Data.FallbackTerminals&amp;#41;.  During the Scanner&amp;#58;&amp;#58;SelectTerminals&amp;#40;char&amp;#41; function call, the terminals are just copied from Data.FallbackTerminals into termList &amp;#40;line &amp;#35;202&amp;#41;, and no other sorting takes place in this function.&lt;br /&gt;&lt;br /&gt;In my grammar, the terminals are declared as&amp;#58;&lt;br /&gt;&lt;br /&gt;var endOfLineText &amp;#61; new CustomTerminal&amp;#40;&amp;#34;EndOfLineText_Custom&amp;#34;, EndOfLineTextMatcher&amp;#41;&amp;#59;&lt;br /&gt;var messageText &amp;#61; new FreeTextLiteral&amp;#40;&amp;#34;MessageText&amp;#34;, &amp;#34;&amp;#123;&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;messageText.Priority &amp;#61; Terminal.HighestPriority&amp;#59;&lt;br /&gt;&lt;br /&gt;I have tried reodering the declarations, adjusting the priorities on both, but with no luck.  The current work-around that I&amp;#39;m using is to name them as &amp;#34;A_MessageText&amp;#34; and &amp;#34;Z_EndOfLineText_Custom&amp;#34; in order to get them to &amp;#34;sort&amp;#34; correctly &amp;#40;alphanumerically where &amp;#34;A_&amp;#42;&amp;#42;&amp;#42;&amp;#34; ends up with a higher &amp;#39;priority&amp;#39; than &amp;#34;Z_&amp;#42;&amp;#42;&amp;#42;&amp;#34;.&lt;br /&gt;&lt;br /&gt;If you could get it so that it takes the priorities into consideration, I would greatly appreciate it.  Thanks&amp;#33;&lt;br /&gt;</description><author>rivantsov</author><pubDate>Wed, 18 Nov 2009 16:22:24 GMT</pubDate><guid isPermaLink="false">Commented Issue: Custom &amp; FreeTextLiteral Terminals are not sorted by priority [6291] 20091118042224P</guid></item><item><title>Created Issue: Custom &amp; FreeTextLiteral Terminals are not sorted by priority [6291]</title><link>http://irony.codeplex.com/WorkItem/View.aspx?WorkItemId=6291</link><description>Hey Roman,&lt;br /&gt;&lt;br /&gt;First of all, I must say, great work&amp;#33;  I&amp;#39;ve been using Irony for a little over a month with awesome results, but I finally ran into this bug.&lt;br /&gt;&lt;br /&gt;I have two terminals, a CustomTerminal and a FreeTextLiteral.  It seems that the terminals are being sorted by token name rather than priority.  &amp;#40;They are stored in alphanumerically ascending order in Scanner&amp;#58;&amp;#58;Data.FallbackTerminals&amp;#41;.  During the Scanner&amp;#58;&amp;#58;SelectTerminals&amp;#40;char&amp;#41; function call, the terminals are just copied from Data.FallbackTerminals into termList &amp;#40;line &amp;#35;202&amp;#41;, and no other sorting takes place in this function.&lt;br /&gt;&lt;br /&gt;In my grammar, the terminals are declared as&amp;#58;&lt;br /&gt;&lt;br /&gt;var endOfLineText &amp;#61; new CustomTerminal&amp;#40;&amp;#34;EndOfLineText_Custom&amp;#34;, EndOfLineTextMatcher&amp;#41;&amp;#59;&lt;br /&gt;var messageText &amp;#61; new FreeTextLiteral&amp;#40;&amp;#34;MessageText&amp;#34;, &amp;#34;&amp;#123;&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;messageText.Priority &amp;#61; Terminal.HighestPriority&amp;#59;&lt;br /&gt;&lt;br /&gt;I have tried reodering the declarations, adjusting the priorities on both, but with no luck.  The current work-around that I&amp;#39;m using is to name them as &amp;#34;A_MessageText&amp;#34; and &amp;#34;Z_EndOfLineText_Custom&amp;#34; in order to get them to &amp;#34;sort&amp;#34; correctly &amp;#40;alphanumerically where &amp;#34;A_&amp;#42;&amp;#42;&amp;#42;&amp;#34; ends up with a higher &amp;#39;priority&amp;#39; than &amp;#34;Z_&amp;#42;&amp;#42;&amp;#42;&amp;#34;.&lt;br /&gt;&lt;br /&gt;If you could get it so that it takes the priorities into consideration, I would greatly appreciate it.  Thanks&amp;#33;&lt;br /&gt;</description><author>bdaugherty</author><pubDate>Tue, 17 Nov 2009 14:56:46 GMT</pubDate><guid isPermaLink="false">Created Issue: Custom &amp; FreeTextLiteral Terminals are not sorted by priority [6291] 20091117025646P</guid></item><item><title>Closed Issue: Polish charset [6174]</title><link>http://irony.codeplex.com/WorkItem/View.aspx?WorkItemId=6174</link><description>Hi&amp;#33;&lt;br /&gt;&lt;br /&gt;I am using IdentifierTerminal&lt;br /&gt;var identifier &amp;#61; new IdentifierTerminal&amp;#40;&amp;#34;Term&amp;#34;, &amp;#34;&amp;#33;&amp;#64;&amp;#35;&amp;#36;&amp;#37;&amp;#94;&amp;#42;_&amp;#39;.&amp;#63;&amp;#34;, &amp;#34;&amp;#33;&amp;#64;&amp;#35;&amp;#36;&amp;#37;&amp;#94;&amp;#42;_&amp;#39;.&amp;#63;0123456789&amp;#34;&amp;#41;&lt;br /&gt;&lt;br /&gt;I have to add polish chars like &amp;#261;&amp;#260;&amp;#263;&amp;#262;&amp;#281;&amp;#280;&amp;#322;&amp;#321;&amp;#243;&amp;#211;&amp;#324;&amp;#323;&amp;#380;&amp;#379;&amp;#378;&amp;#377; so i changed declaration to&amp;#58;&lt;br /&gt;var identifier &amp;#61; new IdentifierTerminal&amp;#40;&amp;#34;Term&amp;#34;, &amp;#34;&amp;#33;&amp;#64;&amp;#35;&amp;#36;&amp;#37;&amp;#94;&amp;#42;_&amp;#39;.&amp;#63;&amp;#261;&amp;#260;&amp;#263;&amp;#262;&amp;#281;&amp;#280;&amp;#322;&amp;#321;&amp;#243;&amp;#211;&amp;#324;&amp;#323;&amp;#380;&amp;#379;&amp;#378;&amp;#377;&amp;#34;, &amp;#34;&amp;#33;&amp;#64;&amp;#35;&amp;#36;&amp;#37;&amp;#94;&amp;#42;_&amp;#39;.&amp;#63;0123456789&amp;#261;&amp;#260;&amp;#263;&amp;#262;&amp;#281;&amp;#280;&amp;#322;&amp;#321;&amp;#243;&amp;#211;&amp;#324;&amp;#323;&amp;#380;&amp;#379;&amp;#378;&amp;#377;&amp;#34;&amp;#41;&lt;br /&gt;&lt;br /&gt;Irony still not works with my polish chars. Maybe its problem with unicodes&amp;#63;&lt;br /&gt;            &lt;br /&gt;Kamil&lt;br /&gt;</description><author>rivantsov</author><pubDate>Mon, 09 Nov 2009 22:56:23 GMT</pubDate><guid isPermaLink="false">Closed Issue: Polish charset [6174] 20091109105623P</guid></item><item><title>Commented Issue: Polish charset [6174]</title><link>http://irony.codeplex.com/WorkItem/View.aspx?WorkItemId=6174</link><description>Hi&amp;#33;&lt;br /&gt;&lt;br /&gt;I am using IdentifierTerminal&lt;br /&gt;var identifier &amp;#61; new IdentifierTerminal&amp;#40;&amp;#34;Term&amp;#34;, &amp;#34;&amp;#33;&amp;#64;&amp;#35;&amp;#36;&amp;#37;&amp;#94;&amp;#42;_&amp;#39;.&amp;#63;&amp;#34;, &amp;#34;&amp;#33;&amp;#64;&amp;#35;&amp;#36;&amp;#37;&amp;#94;&amp;#42;_&amp;#39;.&amp;#63;0123456789&amp;#34;&amp;#41;&lt;br /&gt;&lt;br /&gt;I have to add polish chars like &amp;#261;&amp;#260;&amp;#263;&amp;#262;&amp;#281;&amp;#280;&amp;#322;&amp;#321;&amp;#243;&amp;#211;&amp;#324;&amp;#323;&amp;#380;&amp;#379;&amp;#378;&amp;#377; so i changed declaration to&amp;#58;&lt;br /&gt;var identifier &amp;#61; new IdentifierTerminal&amp;#40;&amp;#34;Term&amp;#34;, &amp;#34;&amp;#33;&amp;#64;&amp;#35;&amp;#36;&amp;#37;&amp;#94;&amp;#42;_&amp;#39;.&amp;#63;&amp;#261;&amp;#260;&amp;#263;&amp;#262;&amp;#281;&amp;#280;&amp;#322;&amp;#321;&amp;#243;&amp;#211;&amp;#324;&amp;#323;&amp;#380;&amp;#379;&amp;#378;&amp;#377;&amp;#34;, &amp;#34;&amp;#33;&amp;#64;&amp;#35;&amp;#36;&amp;#37;&amp;#94;&amp;#42;_&amp;#39;.&amp;#63;0123456789&amp;#261;&amp;#260;&amp;#263;&amp;#262;&amp;#281;&amp;#280;&amp;#322;&amp;#321;&amp;#243;&amp;#211;&amp;#324;&amp;#323;&amp;#380;&amp;#379;&amp;#378;&amp;#377;&amp;#34;&amp;#41;&lt;br /&gt;&lt;br /&gt;Irony still not works with my polish chars. Maybe its problem with unicodes&amp;#63;&lt;br /&gt;            &lt;br /&gt;Kamil&lt;br /&gt;</description><author>beny</author><pubDate>Mon, 09 Nov 2009 19:14:05 GMT</pubDate><guid isPermaLink="false">Commented Issue: Polish charset [6174] 20091109071405P</guid></item><item><title>Created Issue: Polish charset [6174]</title><link>http://irony.codeplex.com/WorkItem/View.aspx?WorkItemId=6174</link><description>Hi&amp;#33;&lt;br /&gt;&lt;br /&gt;I am using IdentifierTerminal&lt;br /&gt;var identifier &amp;#61; new IdentifierTerminal&amp;#40;&amp;#34;Term&amp;#34;, &amp;#34;&amp;#33;&amp;#64;&amp;#35;&amp;#36;&amp;#37;&amp;#94;&amp;#42;_&amp;#39;.&amp;#63;&amp;#34;, &amp;#34;&amp;#33;&amp;#64;&amp;#35;&amp;#36;&amp;#37;&amp;#94;&amp;#42;_&amp;#39;.&amp;#63;0123456789&amp;#34;&amp;#41;&lt;br /&gt;&lt;br /&gt;I have to add polish chars like &amp;#261;&amp;#260;&amp;#263;&amp;#262;&amp;#281;&amp;#280;&amp;#322;&amp;#321;&amp;#243;&amp;#211;&amp;#324;&amp;#323;&amp;#380;&amp;#379;&amp;#378;&amp;#377; so i changed declaration to&amp;#58;&lt;br /&gt;var identifier &amp;#61; new IdentifierTerminal&amp;#40;&amp;#34;Term&amp;#34;, &amp;#34;&amp;#33;&amp;#64;&amp;#35;&amp;#36;&amp;#37;&amp;#94;&amp;#42;_&amp;#39;.&amp;#63;&amp;#261;&amp;#260;&amp;#263;&amp;#262;&amp;#281;&amp;#280;&amp;#322;&amp;#321;&amp;#243;&amp;#211;&amp;#324;&amp;#323;&amp;#380;&amp;#379;&amp;#378;&amp;#377;&amp;#34;, &amp;#34;&amp;#33;&amp;#64;&amp;#35;&amp;#36;&amp;#37;&amp;#94;&amp;#42;_&amp;#39;.&amp;#63;0123456789&amp;#261;&amp;#260;&amp;#263;&amp;#262;&amp;#281;&amp;#280;&amp;#322;&amp;#321;&amp;#243;&amp;#211;&amp;#324;&amp;#323;&amp;#380;&amp;#379;&amp;#378;&amp;#377;&amp;#34;&amp;#41;&lt;br /&gt;&lt;br /&gt;Irony still not works with my polish chars. Maybe its problem with unicodes&amp;#63;&lt;br /&gt;            &lt;br /&gt;Kamil&lt;br /&gt;</description><author>beny</author><pubDate>Mon, 09 Nov 2009 12:01:24 GMT</pubDate><guid isPermaLink="false">Created Issue: Polish charset [6174] 20091109120124P</guid></item><item><title>Closed Issue: Unary operator evaluation [4901]</title><link>http://irony.codeplex.com/WorkItem/View.aspx?WorkItemId=4901</link><description>When evaluating unary operators the second argument in the context should be set to null.&lt;br /&gt;&lt;br /&gt;I declared a call dispatcher for a unary operator &amp;#34;not&amp;#34; just for booleans and I kept getting that it was not defined for System.String because there was a reminder string in the second argument from the context from the previous evaluation.&lt;br /&gt;</description><author>rivantsov</author><pubDate>Mon, 09 Nov 2009 07:05:34 GMT</pubDate><guid isPermaLink="false">Closed Issue: Unary operator evaluation [4901] 20091109070534A</guid></item><item><title>Closed Issue: Shadow Copy Assemblies when loading into explorer [5874]</title><link>http://irony.codeplex.com/WorkItem/View.aspx?WorkItemId=5874</link><description>I liked using the Grammar Explorer during development but found myself constantly closing and re-opening it to be able to compile new assemblies.  the NUnit GUI runner uses shadow copies to avoid interfering with new builds and will automatically re-load new assemblies.  I think this is a great idea and most of the implementation can probably be borrowed from NUnit.&lt;br /&gt;</description><author>rivantsov</author><pubDate>Mon, 09 Nov 2009 07:04:25 GMT</pubDate><guid isPermaLink="false">Closed Issue: Shadow Copy Assemblies when loading into explorer [5874] 20091109070425A</guid></item><item><title>Commented Issue: Shadow Copy Assemblies when loading into explorer [5874]</title><link>http://irony.codeplex.com/WorkItem/View.aspx?WorkItemId=5874</link><description>I liked using the Grammar Explorer during development but found myself constantly closing and re-opening it to be able to compile new assemblies.  the NUnit GUI runner uses shadow copies to avoid interfering with new builds and will automatically re-load new assemblies.  I think this is a great idea and most of the implementation can probably be borrowed from NUnit.&lt;br /&gt;Comments: ** Comment from web user: rivantsov ** &lt;p&gt;Thanks for your suggestion. Yes, that would be nice to have GrExpl running all the time, rebuild the grammar assembly when needed and make it reload automatically. But... correct me if I&amp;#39;m wrong, but from what I know&amp;#47;remember about how NUnit does this &amp;#40;and any other app&amp;#41; is by loading tested assembly into a separate app domain and executing tests there. After the tests are run the domain is unloaded, shadow or any other copies on disk are unlocked and you can overwrite them. It is a limitation of .NET fwk that once assembly is loaded, it cannot be unloaded, ever - unless it is loaded into separate domain, and the entire domain is unloaded. So having shadow copy is not enough - once you loaded assembly from it, it is locked for writing, and you cannot overwrite it with newer version. &lt;br /&gt;As for loading grammar into a separate domain - hmm.. maybe, but certain compilcations may arise, and performance may suffer for sure. It will require more careful analysis of what&amp;#39;s involved. Wanna try it&amp;#63; I cannot get to it now, have a long to do list already. So far, it is inconvenience, annoyance at worst, but not that serious I hope... &lt;br /&gt;thanks again&lt;br /&gt;Roman&lt;/p&gt;</description><author>rivantsov</author><pubDate>Wed, 21 Oct 2009 04:55:35 GMT</pubDate><guid isPermaLink="false">Commented Issue: Shadow Copy Assemblies when loading into explorer [5874] 20091021045535A</guid></item><item><title>Created Issue: Shadow Copy Assemblies when loading into explorer [5874]</title><link>http://irony.codeplex.com/WorkItem/View.aspx?WorkItemId=5874</link><description>I liked using the Grammar Explorer during development but found myself constantly closing and re-opening it to be able to compile new assemblies.  the NUnit GUI runner uses shadow copies to avoid interfering with new builds and will automatically re-load new assemblies.  I think this is a great idea and most of the implementation can probably be borrowed from NUnit.&lt;br /&gt;</description><author>shiften</author><pubDate>Tue, 20 Oct 2009 03:44:27 GMT</pubDate><guid isPermaLink="false">Created Issue: Shadow Copy Assemblies when loading into explorer [5874] 20091020034427A</guid></item><item><title>Closed Issue: Grammar.CurrentGrammar can lead to nasty bugs with more than a single grammar derived object [5709]</title><link>http://irony.codeplex.com/WorkItem/View.aspx?WorkItemId=5709</link><description>Using the latest Irony code drop &amp;#40;33075&amp;#41;.&lt;br /&gt;&lt;br /&gt;I am developing a grammar and a simple compiler for a subset of the C preprocessor language.&lt;br /&gt;Initially I had the compiler class create the grammar on each call to my Compile method.  &lt;br /&gt;But I decided to change that and to have the grammar object as a singleton to be created once.  After I did that my unit tests started to fail in what looked like totally random places.&lt;br /&gt;&lt;br /&gt;The reason was, that some of my unit tests also created the grammar object directly, in order to check the correctness of the parse tree for simple grammars.&lt;br /&gt;Since my test runner &amp;#40;xUnit&amp;#41; runs the unit tests in a random order, this changed the Grammar.CurrentGrammar static property because a new Grammar object was created &amp;#40;randomly&amp;#41;.  However, the old one was still alive and was used in later tests.&lt;br /&gt;&lt;br /&gt;This caused the following bug&amp;#58;&lt;br /&gt;In GrammarDataBuilder.CreateProduction&amp;#40;&amp;#41;, the following condition&amp;#58;&lt;br /&gt;        if &amp;#40;operand &amp;#61;&amp;#61; Grammar.CurrentGrammar.Empty&amp;#41;&lt;br /&gt;failed even when operand is the Empty keyword, because the Empty in operand was created in a different Grammar object than the one in Grammar.CurrentGrammar.  So Empty terminals were not skipped, and this stage produced a grammar with incorrect productions.&lt;br /&gt;&lt;br /&gt;IMHO, using the static CurrentGrammar field is more trouble than it&amp;#8217;s worth.&lt;br /&gt;In this specific method, there is no reason to use it, since GrammarDataBuilder has a _grammar field which points back to the correct grammar we&amp;#8217;re working on.&lt;br /&gt;&lt;br /&gt;Possible workarounds &amp;#40;in the current release, without changing Irony code&amp;#41;&amp;#58;&lt;br /&gt;- Always create a new Grammar object before using it&lt;br /&gt;- If using a Grammar singleton, then before using it, check if &amp;#40;Grammar.CurrentGrammar &amp;#33;&amp;#61; grammarSingleton&amp;#41; and if so, some other Grammar has &amp;#8220;stolen&amp;#8221; the CurrentGrammar reference, and we need to restore it by recreating the Grammar object.&lt;br /&gt;Comments: &lt;p&gt;Fixed in latest drop&lt;/p&gt;</description><author>rivantsov</author><pubDate>Tue, 13 Oct 2009 22:38:53 GMT</pubDate><guid isPermaLink="false">Closed Issue: Grammar.CurrentGrammar can lead to nasty bugs with more than a single grammar derived object [5709] 20091013103853P</guid></item><item><title>Commented Issue: Grammar.CurrentGrammar can lead to nasty bugs with more than a single grammar derived object [5709]</title><link>http://irony.codeplex.com/WorkItem/View.aspx?WorkItemId=5709</link><description>Using the latest Irony code drop &amp;#40;33075&amp;#41;.&lt;br /&gt;&lt;br /&gt;I am developing a grammar and a simple compiler for a subset of the C preprocessor language.&lt;br /&gt;Initially I had the compiler class create the grammar on each call to my Compile method.  &lt;br /&gt;But I decided to change that and to have the grammar object as a singleton to be created once.  After I did that my unit tests started to fail in what looked like totally random places.&lt;br /&gt;&lt;br /&gt;The reason was, that some of my unit tests also created the grammar object directly, in order to check the correctness of the parse tree for simple grammars.&lt;br /&gt;Since my test runner &amp;#40;xUnit&amp;#41; runs the unit tests in a random order, this changed the Grammar.CurrentGrammar static property because a new Grammar object was created &amp;#40;randomly&amp;#41;.  However, the old one was still alive and was used in later tests.&lt;br /&gt;&lt;br /&gt;This caused the following bug&amp;#58;&lt;br /&gt;In GrammarDataBuilder.CreateProduction&amp;#40;&amp;#41;, the following condition&amp;#58;&lt;br /&gt;        if &amp;#40;operand &amp;#61;&amp;#61; Grammar.CurrentGrammar.Empty&amp;#41;&lt;br /&gt;failed even when operand is the Empty keyword, because the Empty in operand was created in a different Grammar object than the one in Grammar.CurrentGrammar.  So Empty terminals were not skipped, and this stage produced a grammar with incorrect productions.&lt;br /&gt;&lt;br /&gt;IMHO, using the static CurrentGrammar field is more trouble than it&amp;#8217;s worth.&lt;br /&gt;In this specific method, there is no reason to use it, since GrammarDataBuilder has a _grammar field which points back to the correct grammar we&amp;#8217;re working on.&lt;br /&gt;&lt;br /&gt;Possible workarounds &amp;#40;in the current release, without changing Irony code&amp;#41;&amp;#58;&lt;br /&gt;- Always create a new Grammar object before using it&lt;br /&gt;- If using a Grammar singleton, then before using it, check if &amp;#40;Grammar.CurrentGrammar &amp;#33;&amp;#61; grammarSingleton&amp;#41; and if so, some other Grammar has &amp;#8220;stolen&amp;#8221; the CurrentGrammar reference, and we need to restore it by recreating the Grammar object.&lt;br /&gt;Comments: ** Comment from web user: orwen ** &lt;p&gt;Hi, thanks for your quick response.&lt;br /&gt;I looked again into the usage of CurrentGrammar in the helper methods you mentioned, and now I agree that your usage of it there, it does solve the problem, allowing easy usage of the custom operators when defining a custom grammar &amp;#40;which is one of the great things about Irony&amp;#41;.&lt;/p&gt;&lt;p&gt;Sorry if I&amp;#8217;ve been harsh, the bug wasn&amp;#8217;t that difficult to find.&lt;br /&gt;I think Irony is a great parser library, quite easy to understand and work with.  I appreciate all the work you put into it&amp;#33;&lt;br /&gt;&lt;/p&gt;</description><author>orwen</author><pubDate>Fri, 09 Oct 2009 16:15:57 GMT</pubDate><guid isPermaLink="false">Commented Issue: Grammar.CurrentGrammar can lead to nasty bugs with more than a single grammar derived object [5709] 20091009041557P</guid></item><item><title>Commented Issue: Grammar.CurrentGrammar can lead to nasty bugs with more than a single grammar derived object [5709]</title><link>http://irony.codeplex.com/WorkItem/View.aspx?WorkItemId=5709</link><description>Using the latest Irony code drop &amp;#40;33075&amp;#41;.&lt;br /&gt;&lt;br /&gt;I am developing a grammar and a simple compiler for a subset of the C preprocessor language.&lt;br /&gt;Initially I had the compiler class create the grammar on each call to my Compile method.  &lt;br /&gt;But I decided to change that and to have the grammar object as a singleton to be created once.  After I did that my unit tests started to fail in what looked like totally random places.&lt;br /&gt;&lt;br /&gt;The reason was, that some of my unit tests also created the grammar object directly, in order to check the correctness of the parse tree for simple grammars.&lt;br /&gt;Since my test runner &amp;#40;xUnit&amp;#41; runs the unit tests in a random order, this changed the Grammar.CurrentGrammar static property because a new Grammar object was created &amp;#40;randomly&amp;#41;.  However, the old one was still alive and was used in later tests.&lt;br /&gt;&lt;br /&gt;This caused the following bug&amp;#58;&lt;br /&gt;In GrammarDataBuilder.CreateProduction&amp;#40;&amp;#41;, the following condition&amp;#58;&lt;br /&gt;        if &amp;#40;operand &amp;#61;&amp;#61; Grammar.CurrentGrammar.Empty&amp;#41;&lt;br /&gt;failed even when operand is the Empty keyword, because the Empty in operand was created in a different Grammar object than the one in Grammar.CurrentGrammar.  So Empty terminals were not skipped, and this stage produced a grammar with incorrect productions.&lt;br /&gt;&lt;br /&gt;IMHO, using the static CurrentGrammar field is more trouble than it&amp;#8217;s worth.&lt;br /&gt;In this specific method, there is no reason to use it, since GrammarDataBuilder has a _grammar field which points back to the correct grammar we&amp;#8217;re working on.&lt;br /&gt;&lt;br /&gt;Possible workarounds &amp;#40;in the current release, without changing Irony code&amp;#41;&amp;#58;&lt;br /&gt;- Always create a new Grammar object before using it&lt;br /&gt;- If using a Grammar singleton, then before using it, check if &amp;#40;Grammar.CurrentGrammar &amp;#33;&amp;#61; grammarSingleton&amp;#41; and if so, some other Grammar has &amp;#8220;stolen&amp;#8221; the CurrentGrammar reference, and we need to restore it by recreating the Grammar object.&lt;br /&gt;Comments: ** Comment from web user: rivantsov ** &lt;p&gt;You are right, it is a nasty bug. But the problem is not this static property by itself, just the use of it in this place. It was created to be used exclusively in helper methods of Grammar class which are called from custom grammar constructor &amp;#40;op_Plus, op_Pipe, Star, etc&amp;#41;. There was a long search for solution for these methods, and thread-static CurrentGrammar property is a perfect solution. Using it in parser builder is a bug, don&amp;#39;t know how it got there. I will fix it.  &lt;br /&gt;Thanks for finding it and sorry for your troubles&lt;br /&gt;Roman&lt;/p&gt;</description><author>rivantsov</author><pubDate>Mon, 05 Oct 2009 15:35:22 GMT</pubDate><guid isPermaLink="false">Commented Issue: Grammar.CurrentGrammar can lead to nasty bugs with more than a single grammar derived object [5709] 20091005033522P</guid></item><item><title>Created Issue: Grammar.CurrentGrammar can lead to nasty bugs with more than a single grammar derived object [5709]</title><link>http://irony.codeplex.com/WorkItem/View.aspx?WorkItemId=5709</link><description>Using the latest Irony code drop &amp;#40;33075&amp;#41;.&lt;br /&gt;&lt;br /&gt;I am developing a grammar and a simple compiler for a subset of the C preprocessor language.&lt;br /&gt;Initially I had the compiler class create the grammar on each call to my Compile method.  &lt;br /&gt;But I decided to change that and to have the grammar object as a singleton to be created once.  After I did that my unit tests started to fail in what looked like totally random places.&lt;br /&gt;&lt;br /&gt;The reason was, that some of my unit tests also created the grammar object directly, in order to check the correctness of the parse tree for simple grammars.&lt;br /&gt;Since my test runner &amp;#40;xUnit&amp;#41; runs the unit tests in a random order, this changed the Grammar.CurrentGrammar static property because a new Grammar object was created &amp;#40;randomly&amp;#41;.  However, the old one was still alive and was used in later tests.&lt;br /&gt;&lt;br /&gt;This caused the following bug&amp;#58;&lt;br /&gt;In GrammarDataBuilder.CreateProduction&amp;#40;&amp;#41;, the following condition&amp;#58;&lt;br /&gt;        if &amp;#40;operand &amp;#61;&amp;#61; Grammar.CurrentGrammar.Empty&amp;#41;&lt;br /&gt;failed even when operand is the Empty keyword, because the Empty in operand was created in a different Grammar object than the one in Grammar.CurrentGrammar.  So Empty terminals were not skipped, and this stage produced a grammar with incorrect productions.&lt;br /&gt;&lt;br /&gt;IMHO, using the static CurrentGrammar field is more trouble than it&amp;#8217;s worth.&lt;br /&gt;In this specific method, there is no reason to use it, since GrammarDataBuilder has a _grammar field which points back to the correct grammar we&amp;#8217;re working on.&lt;br /&gt;&lt;br /&gt;Possible workarounds &amp;#40;in the current release, without changing Irony code&amp;#41;&amp;#58;&lt;br /&gt;- Always create a new Grammar object before using it&lt;br /&gt;- If using a Grammar singleton, then before using it, check if &amp;#40;Grammar.CurrentGrammar &amp;#33;&amp;#61; grammarSingleton&amp;#41; and if so, some other Grammar has &amp;#8220;stolen&amp;#8221; the CurrentGrammar reference, and we need to restore it by recreating the Grammar object.&lt;br /&gt;</description><author>orwen</author><pubDate>Sat, 03 Oct 2009 22:36:56 GMT</pubDate><guid isPermaLink="false">Created Issue: Grammar.CurrentGrammar can lead to nasty bugs with more than a single grammar derived object [5709] 20091003103656P</guid></item><item><title>Commented Issue: Assembly generation failed -- Referenced assembly 'Irony' does not have a strong name</title><link>http://irony.codeplex.com/WorkItem/View.aspx?WorkItemId=5174</link><description>Hello...I was getting this error when trying to use Irony inside a solution that had a key generated for another project.  Apparently, if you try to mix key-signed with not signed assemblies you get this.  &lt;br /&gt;&lt;br /&gt;I generated a key for Irony on my local copy and it was fixed but you might want to generate a key for Irony and check it into the subversion.&lt;br /&gt;Comments: ** Comment from web user: rivantsov ** &lt;p&gt;Added assembly key&lt;/p&gt;</description><author>rivantsov</author><pubDate>Sun, 02 Aug 2009 04:27:33 GMT</pubDate><guid isPermaLink="false">Commented Issue: Assembly generation failed -- Referenced assembly 'Irony' does not have a strong name 20090802042733A</guid></item><item><title>Commented Issue: Assembly generation failed -- Referenced assembly 'Irony' does not have a strong name</title><link>http://irony.codeplex.com/WorkItem/View.aspx?WorkItemId=5174</link><description>Hello...I was getting this error when trying to use Irony inside a solution that had a key generated for another project.  Apparently, if you try to mix key-signed with not signed assemblies you get this.  &lt;br /&gt;&lt;br /&gt;I generated a key for Irony on my local copy and it was fixed but you might want to generate a key for Irony and check it into the subversion.&lt;br /&gt;Comments: ** Comment from web user: rivantsov ** &lt;p&gt;thanks for pointing to this, will give it a thought&lt;/p&gt;</description><author>rivantsov</author><pubDate>Wed, 22 Jul 2009 20:10:44 GMT</pubDate><guid isPermaLink="false">Commented Issue: Assembly generation failed -- Referenced assembly 'Irony' does not have a strong name 20090722081044P</guid></item><item><title>Created Issue: Assembly generation failed -- Referenced assembly 'Irony' does not have a strong name</title><link>http://irony.codeplex.com/WorkItem/View.aspx?WorkItemId=5174</link><description>Hello...I was getting this error when trying to use Irony inside a solution that had a key generated for another project.  Apparently, if you try to mix key-signed with not signed assemblies you get this.  &lt;br /&gt;&lt;br /&gt;I generated a key for Irony on my local copy and it was fixed but you might want to generate a key for Irony and check it into the subversion.&lt;br /&gt;</description><author>budmandave</author><pubDate>Wed, 22 Jul 2009 20:01:30 GMT</pubDate><guid isPermaLink="false">Created Issue: Assembly generation failed -- Referenced assembly 'Irony' does not have a strong name 20090722080130P</guid></item><item><title>Commented Issue: Unary operator evaluation</title><link>http://irony.codeplex.com/WorkItem/View.aspx?WorkItemId=4901</link><description>When evaluating unary operators the second argument in the context should be set to null.&lt;br /&gt;&lt;br /&gt;I declared a call dispatcher for a unary operator &amp;#34;not&amp;#34; just for booleans and I kept getting that it was not defined for System.String because there was a reminder string in the second argument from the context from the previous evaluation.&lt;br /&gt;Comments: ** Comment from web user: rivantsov ** &lt;p&gt;Will look into this. thanks for catching and reporting. Will fix it when I come to reimplementing runtime in latest source version. &lt;/p&gt;</description><author>rivantsov</author><pubDate>Thu, 09 Jul 2009 23:14:20 GMT</pubDate><guid isPermaLink="false">Commented Issue: Unary operator evaluation 20090709111420P</guid></item><item><title>Commented Issue: Unary operator evaluation</title><link>http://irony.codeplex.com/WorkItem/View.aspx?WorkItemId=4901</link><description>When evaluating unary operators the second argument in the context should be set to null.&lt;br /&gt;&lt;br /&gt;I declared a call dispatcher for a unary operator &amp;#34;not&amp;#34; just for booleans and I kept getting that it was not defined for System.String because there was a reminder string in the second argument from the context from the previous evaluation.&lt;br /&gt;Comments: ** Comment from web user: MichelangeloPM ** &lt;p&gt;&amp;#42;remainder&lt;/p&gt;</description><author>MichelangeloPM</author><pubDate>Thu, 09 Jul 2009 15:15:25 GMT</pubDate><guid isPermaLink="false">Commented Issue: Unary operator evaluation 20090709031525P</guid></item><item><title>Created Issue: Unary operator evaluation</title><link>http://irony.codeplex.com/WorkItem/View.aspx?WorkItemId=4901</link><description>When evaluating unary operators the second argument in the context should be set to null.&lt;br /&gt;&lt;br /&gt;I declared a call dispatcher for a unary operator &amp;#34;not&amp;#34; just for booleans and I kept getting that it was not defined for System.String because there was a reminder string in the second argument from the context from the previous evaluation.&lt;br /&gt;</description><author>MichelangeloPM</author><pubDate>Thu, 09 Jul 2009 15:14:19 GMT</pubDate><guid isPermaLink="false">Created Issue: Unary operator evaluation 20090709031419P</guid></item><item><title>Closed Issue: Possible null reference in Scanner.Parse</title><link>http://irony.codeplex.com/WorkItem/View.aspx?WorkItemId=4477</link><description>I realized &amp;#40;due to weird type resolvement&amp;#41; that the result &amp;#61; stack&amp;#91;0&amp;#93;.Node in the begining of the parse method in Scanner kan result in result being null causing a nullReferenceException in the line below.&lt;br /&gt;This is basically not an Irony error but the error reporting could be better. As it is you&amp;#39;d probably need to debug the Irony source to figure out what caused the null referance. In my case when run out side VS development hive I got an instance of Irony.Grammar instead of my own causing every token to be a syntax error. The weird part was when run in the hive or the Irony explorer everything worked fine. The weirdnees made it very hard to track down which was why I came to think of handling the error cracefully&lt;br /&gt;Comments: &lt;p&gt;&lt;/p&gt;</description><author>rivantsov</author><pubDate>Tue, 02 Jun 2009 17:26:36 GMT</pubDate><guid isPermaLink="false">Closed Issue: Possible null reference in Scanner.Parse 20090602052636P</guid></item></channel></rss>