<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" version="2.0"><channel><title>Eric J. Smith</title><link>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/default.aspx</link><description /><dc:language>en</dc:language><generator>Telligent Community (Build: 5.5.133.9594)</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/eric-j-smith" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="eric-j-smith" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>CodeSmith Generator 6.0–Status, Website and Future</title><link>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2011/11/10/codesmith-generator-6-0-status-website-and-future.aspx</link><pubDate>Thu, 10 Nov 2011 21:48:35 GMT</pubDate><guid isPermaLink="false">829aebef-9208-4531-832e-1f916c1e97cb:47638</guid><dc:creator>ejsmith</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/rsscomments.aspx?WeblogPostID=47638</wfw:commentRss><comments>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2011/11/10/codesmith-generator-6-0-status-website-and-future.aspx#comments</comments><description>We are on the home stretch of Generator 6.0 and things have come together really nicely.&amp;#160; This is going to be a great release!&amp;#160; We have been mostly working on performance, memory utilization and bug fixes, and we are doing really good on all...(&lt;a href="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2011/11/10/codesmith-generator-6-0-status-website-and-future.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://community.codesmithtools.com/aggbug.aspx?PostID=47638" width="1" height="1"&gt;</description><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/CodeSmith/default.aspx">CodeSmith</category></item><item><title>CodeSmith Generator 6.0 Beta Survey</title><link>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2011/09/08/codesmith-generator-6-0-beta-survey.aspx</link><pubDate>Thu, 08 Sep 2011 21:22:20 GMT</pubDate><guid isPermaLink="false">829aebef-9208-4531-832e-1f916c1e97cb:46987</guid><dc:creator>ejsmith</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/rsscomments.aspx?WeblogPostID=46987</wfw:commentRss><comments>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2011/09/08/codesmith-generator-6-0-beta-survey.aspx#comments</comments><description>We are currently working on dogfooding the new template editor by updating and building some new templates. Along the way, we are trying to find and fix as many pain points as we possibly can. We are also working on profiling and memory usage reductions...(&lt;a href="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2011/09/08/codesmith-generator-6-0-beta-survey.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://community.codesmithtools.com/aggbug.aspx?PostID=46987" width="1" height="1"&gt;</description></item><item><title>CodeSmith Generator 6.0 – Editor in Action</title><link>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2011/07/14/codesmith-generator-6-0-editor-in-action.aspx</link><pubDate>Thu, 14 Jul 2011 14:30:00 GMT</pubDate><guid isPermaLink="false">829aebef-9208-4531-832e-1f916c1e97cb:46541</guid><dc:creator>ejsmith</dc:creator><slash:comments>12</slash:comments><wfw:commentRss>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/rsscomments.aspx?WeblogPostID=46541</wfw:commentRss><comments>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2011/07/14/codesmith-generator-6-0-editor-in-action.aspx#comments</comments><description>&lt;p&gt;I thought the best way to show our progress so far would be to show you a quick video of the new editor in action. So without further adieu, here is the new CodeSmith Generator 6.0 editor:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://screencast.com/t/q2Pvn0cJzC0"&gt;&lt;img src="http://www.codesmithtools.com/images/editorinaction.jpg" border="0" style="max-width:611px;" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In general, I think our editing experience is already about 10 times better than it was before.&amp;nbsp; Not even counting the fact that it&amp;rsquo;s integrated right into Visual Studio now. We still have some work to do, but we will be releasing a beta version soon.&lt;/p&gt;
&lt;p&gt;Thanks again,&lt;br /&gt;Eric J. Smith&lt;/p&gt;
&lt;p&gt;&lt;a href="http://dotnetshoutout.com/Video-CodeSmith-60-Editor-in-Action" rev="vote-for"&gt;&lt;img style="border:0px;" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fcommunity.codesmithtools.com%2FCodeSmith_Community%2Fb%2Fericjsmith%2Farchive%2F2011%2F07%2F14%2Fcodesmith-generator-6-0-editor-in-action.aspx" alt="Shout it" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://community.codesmithtools.com/aggbug.aspx?PostID=46541" width="1" height="1"&gt;</description><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/Team+Blog/default.aspx">Team Blog</category><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/CodeSmith+Generator+6-0/default.aspx">CodeSmith Generator 6.0</category><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/announcement/default.aspx">announcement</category></item><item><title>CodeSmith Generator 6.0 Alpha</title><link>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2011/05/13/codesmith-generator-6-0-alpha.aspx</link><pubDate>Fri, 13 May 2011 22:07:00 GMT</pubDate><guid isPermaLink="false">829aebef-9208-4531-832e-1f916c1e97cb:46040</guid><dc:creator>ejsmith</dc:creator><slash:comments>5</slash:comments><wfw:commentRss>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/rsscomments.aspx?WeblogPostID=46040</wfw:commentRss><comments>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2011/05/13/codesmith-generator-6-0-alpha.aspx#comments</comments><description>&lt;p&gt;We have been making great progress on CodeSmith Generator 6.0 and would love to get some feedback on our new template engine, template runner UI and new property grid (more on this soon).&amp;nbsp; As I mentioned in a &lt;a href="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2011/03/23/codesmith-generator-6-0-status-and-intellisense.aspx"&gt;previous post&lt;/a&gt;, we have completely re-written the template engine so that we can implement a greatly improved editor / IntelliSense experience as well as make it easy to make future changes to our template syntax.&amp;nbsp; We think we have these core pieces working pretty good and would like to get some early feedback on them while we continue to work on the new editor / Visual Studio integration.&lt;/p&gt;
&lt;h4&gt;&lt;a href="http://www.codesmithtools.com/download/generator-60-alpha.zip"&gt;Download CodeSmith Generator 6.0 Alpha&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Please be aware of a few things with this build:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This is not a full version of CodeSmith Generator.&amp;nbsp; It does not include Visual Studio integration or the CodeSmith Studio template editor.&lt;/li&gt;
&lt;li&gt;It is very likely to have bugs.&lt;/li&gt;
&lt;li&gt;It&amp;rsquo;s a known issue that startup performance when starting CodeSmith.exe needs work.&lt;/li&gt;
&lt;li&gt;That being said, it is simply a zip file and you can use it without effecting your currently installed version of CodeSmith Generator.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We would love to hear any feedback that you might have. Especially if you have problems running your existing templates.&amp;nbsp; Also, please be aware that if you have assemblies that you are referencing from your templates, you may need to recompile them against the 6.0 assemblies to get your template to work.&lt;/p&gt;
&lt;p&gt;&lt;a rev="vote-for" href="http://dotnetshoutout.com/CodeSmith-Generator-60-Alpha"&gt;&lt;img alt="Shout it" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fcommunity.codesmithtools.com%2FCodeSmith_Community%2Fb%2Fericjsmith%2Farchive%2F2011%2F05%2F13%2Fcodesmith-generator-6-0-alpha.aspx" style="border:0px;" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://community.codesmithtools.com/aggbug.aspx?PostID=46040" width="1" height="1"&gt;</description><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/CodeSmith+Generator+6-0/default.aspx">CodeSmith Generator 6.0</category><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/announcement/default.aspx">announcement</category><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/code+generation/default.aspx">code generation</category></item><item><title>CodeSmith Generator 6.0–Status and IntelliSense</title><link>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2011/03/23/codesmith-generator-6-0-status-and-intellisense.aspx</link><pubDate>Wed, 23 Mar 2011 16:29:00 GMT</pubDate><guid isPermaLink="false">829aebef-9208-4531-832e-1f916c1e97cb:45549</guid><dc:creator>ejsmith</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/rsscomments.aspx?WeblogPostID=45549</wfw:commentRss><comments>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2011/03/23/codesmith-generator-6-0-status-and-intellisense.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://community.codesmithtools.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-00-25-metablogapi/6242.IntelliSense_5F00_4C47622C.png"&gt;&lt;img style="background-image:none;border-right-width:0px;margin:0px 0px 1px 11px;padding-left:0px;padding-right:0px;display:inline;float:right;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="IntelliSense" border="0" alt="IntelliSense" align="right" src="http://community.codesmithtools.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-00-25-metablogapi/3108.IntelliSense_5F00_thumb_5F00_7E3F02B6.png" width="212" height="107" /&gt;&lt;/a&gt;Work on Generator 6.0 is progressing pretty nicely. We are code complete on our new parser, new compiler, new caching mechanism, out of process template execution, and WPF based property grid. There is a lot to talk about there, but I have also started working on implementing IntelliSense and I wanted to talk about that today.&lt;/p&gt;  &lt;p&gt;Better working IntelliSense has been our biggest request probably from day one. People tend to take IntelliSense for granted because Microsoft has done a great job with it in Visual Studio and it almost becomes transparent. We just use it and expect it to work without thinking about what goes into it. I was just as guilty of this as everyone else until I started working on implementing it in CodeSmith Studio. Think about it for a second, you have a collection of text files and you need to make sense of them… what goes into that? Here is a simplified list of the steps and parts required for implementing IntelliSense.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Tokenize&lt;/strong&gt; – the first step is to take that text file and create a series of tokens from it.       &lt;ul&gt;       &lt;li&gt;This sounds easy, but in and of itself it can be pretty hard because of ambiguities in languages where certain things have different meanings depending on their context. &lt;/li&gt;        &lt;li&gt;In our case, things are even more complicated by the fact that we are mixing random languages together. &lt;/li&gt;        &lt;li&gt;Also, keep in mind that this needs to be happening in real time as the user types without slowing the editor down. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Parse&lt;/strong&gt; – next we read the tokens in, make sense of them, validate them and construct an abstract syntax tree along the way so that we can have some sort of structure that can be more easily understood, traversed and transformed.       &lt;ul&gt;       &lt;li&gt;This is expensive to build and needs to happen in a background thread and constantly be updated as the user is typing. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Gather Type Information&lt;/strong&gt; – we need a database of reflected and parsed type information from any referenced assemblies and source files so that we can use that information in resolving and knowing what members are available for any given type.       &lt;ul&gt;       &lt;li&gt;It is expensive to reflect over every single type in every single referenced assembly. So you need to cache this information in a structure that makes it really fast to load and search. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Gather Context&lt;/strong&gt; – when an IntelliSense request is made, we need to figure out where we are and provide as much information about our surroundings as possible.       &lt;ul&gt;       &lt;li&gt;Due to the fact that active typing is going on, we have to use a combination of token scanning and looking at our most recent AST to provide this information. &lt;/li&gt;        &lt;li&gt;Also due to active typing, we have to work with an AST that has information that is slightly out of date and we will need to translate that out of date information to the current source. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Resolve&lt;/strong&gt; – now we need to take all of the information that has been gathered and use it to figure out what we are looking at and what options are available to show in the IntelliSense list.       &lt;ul&gt;       &lt;li&gt;There are a lot of rules that come into play here like member scope and precedence for extension methods to name a couple. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Another thing I would like to address is that many people in the past have said to us… &amp;quot;just use Microsoft&amp;#39;s IntelliSense&amp;quot;. Unfortunately, it&amp;#39;s not that easy. Microsoft does not expose their IntelliSense services and, even if they did, we most likely would not be able to use them because they would be very much geared around their use cases which would make them unusable for ours.&lt;/p&gt;  &lt;p&gt;As you can see, there is a LOT of work that goes into providing that handy little drop down menu that magically pops up and makes it so that you don&amp;#39;t have to memorize an entire framework library. We are completely re-writing every single one of those pieces in CodeSmith Generator 6.0 and our end goal is to make it so good that you completely take us for granted because it just magically works. &lt;img style="border-bottom-style:none;border-left-style:none;border-top-style:none;border-right-style:none;" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://community.codesmithtools.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-00-25-metablogapi/8512.wlEmoticon_2D00_smile_5F00_420DB2FB.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://community.codesmithtools.com/aggbug.aspx?PostID=45549" width="1" height="1"&gt;</description><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/Team+Blog/default.aspx">Team Blog</category><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/CodeSmith+Generator+6-0/default.aspx">CodeSmith Generator 6.0</category></item><item><title>CodeSmith Generator 6.0 Template Parser Progress Report - Part 2</title><link>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2011/02/02/codesmith-generator-6-0-template-parser-progress-report-part-2.aspx</link><pubDate>Wed, 02 Feb 2011 18:55:58 GMT</pubDate><guid isPermaLink="false">829aebef-9208-4531-832e-1f916c1e97cb:45038</guid><dc:creator>ejsmith</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/rsscomments.aspx?WeblogPostID=45038</wfw:commentRss><comments>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2011/02/02/codesmith-generator-6-0-template-parser-progress-report-part-2.aspx#comments</comments><description>&lt;p&gt;In this post I’m going to talk about how the new template parser in CodeSmith Generator 6.0 creates an &lt;a href="http://en.wikipedia.org/wiki/Abstract_syntax_tree"&gt;AST&lt;/a&gt; (Abstract Syntax Tree) and then uses the &lt;a href="http://en.wikipedia.org/wiki/Visitor_pattern"&gt;visitor pattern&lt;/a&gt; to iterate over the nodes in the AST and do transformations.&lt;/p&gt;  &lt;p&gt;The grammar rules I talked about in my &lt;a href="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2011/01/04/codesmith-generator-6-0-template-parser-progress-report-part-1.aspx"&gt;previous post&lt;/a&gt; are used to both validate the syntax of the template code and to create typed AST nodes.&amp;#160; Here is a very simple template:&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&amp;lt;%@ CodeTemplate Language=&amp;quot;C#&amp;quot; %&amp;gt;      &lt;br /&gt;&amp;lt;%= DateTime.Now %&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;The resulting AST from the parse looks like this:&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;DirectiveNode Name=CodeTemplate      &lt;br /&gt;&amp;#160; AttributeNode Language=C#       &lt;br /&gt;ExpressionNode       &lt;br /&gt;&amp;#160; ValueNode DateTime.Now&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Each node in the AST implements a visitor pattern and I’m actually using a visitor to generate the AST visualization above.&amp;#160; The visitor recursively goes through each node in the hierarchy and calls the Visit method for that specific node type.&amp;#160; So I end up with a visitor class that looks like this:&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;public class VisualizeTemplateVisitor : TemplateAstVisitorBase      &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; …       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; public override void Visit(DirectiveNode node)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _builder.Append(&amp;quot;DirectiveNode Name=&amp;quot;);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _builder.AppendLine(node.Value.Trim());       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; public override void Visit(AttributeNode node)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _builder.Append(&amp;quot;&amp;#160; AttributeNode &amp;quot;);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _builder.Append(node.Name.Trim());       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _builder.Append(&amp;quot;=&amp;quot;);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _builder.AppendLine(Format(node.Value));       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; …       &lt;br /&gt;}&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;I simply call the Accept method on the visitor and pass it the root node that I want to visit and it creates the output above:&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;string nodeVisualization = VisualizeTemplateVisitor.Accept(templateNode)&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;This pattern is used extensively in the new parser.&amp;#160; Here are some of the visitors I have so far in the new parser:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;CollapseWhitespaceVisitor – used to traverse the AST and remove whitespace and line break nodes from lines that only contain template code.&amp;#160; This visitor actually modifies the AST while it is visiting it. &lt;/li&gt;    &lt;li&gt;PopulateParseResultVisitor – used to gather information about the template like what sub-templates are referenced, what include files are referenced, what assembly references are declared, what language the template is using (ie. C#, VB, JS) and many other things. &lt;/li&gt;    &lt;li&gt;GenerateCompileUnitVisitor – used to generate a CodeDOM compile unit from the AST that can be fed into the .NET compiler and create an assembly. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;By creating an AST and using the visitor pattern, I’m able to do any sort of transformation that I want by simply creating a new visitor and plugging it into the template compilation pipeline.&amp;#160; As you can imagine, this ends up being a much cleaner, simpler and extensible solution than what we had before.&amp;#160; We may even expose the compilation pipeline with MEF in CodeSmith Generator 6.0 so that anyone could make changes to the generated code or implement new template directives.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://community.codesmithtools.com/aggbug.aspx?PostID=45038" width="1" height="1"&gt;</description><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/Team+Blog/default.aspx">Team Blog</category><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/CodeSmith+Generator+6-0/default.aspx">CodeSmith Generator 6.0</category></item><item><title>CodeSmith Generator 6.0 Template Parser Progress Report - Part 1</title><link>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2011/01/04/codesmith-generator-6-0-template-parser-progress-report-part-1.aspx</link><pubDate>Wed, 05 Jan 2011 00:00:00 GMT</pubDate><guid isPermaLink="false">829aebef-9208-4531-832e-1f916c1e97cb:44691</guid><dc:creator>ejsmith</dc:creator><slash:comments>9</slash:comments><wfw:commentRss>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/rsscomments.aspx?WeblogPostID=44691</wfw:commentRss><comments>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2011/01/04/codesmith-generator-6-0-template-parser-progress-report-part-1.aspx#comments</comments><description>&lt;p&gt;I am currently working on the new parser for CodeSmith Generator 6.0.&amp;nbsp; When I wrote the original template parser back in 2004, I really had no idea what I was doing. :-)&amp;nbsp; I had no idea what an &lt;a href="http://en.wikipedia.org/wiki/Abstract_syntax_tree"&gt;AST&lt;/a&gt; was or what an &lt;a href="http://en.wikipedia.org/wiki/LL_parser"&gt;LL(*) parser&lt;/a&gt; was, etc.&amp;nbsp; That being said, I think I did an OK job and it has certainly served it&amp;rsquo;s purpose, but it can&amp;rsquo;t be easily changed and things are more complicated than they need to be. &lt;/p&gt;
&lt;p&gt;I have been working on our new parser for a few weeks now and I have a pretty good start.&amp;nbsp; Here is a list of things that we want to get out of the new parser:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Structure&lt;/strong&gt; - Generate an AST as an intermediate step so that we can do transformations using a Visitor pattern and even LINQ queries. &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Grammar&lt;/strong&gt; - Create a grammar for the syntax so that we can give grammar errors. &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Testability&lt;/strong&gt; - Make it easy to unit test. &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Maintainability&lt;/strong&gt; - Make it easy to implement changes and add new features. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I decided to make use of the parser framework that &lt;a href="http://www.actiprosoftware.com/"&gt;Actipro&lt;/a&gt; includes with their &lt;a href="http://www.actiprosoftware.com/products/dotnet/wpf/syntaxeditor/default.aspx"&gt;SyntaxEditor&lt;/a&gt; control.&amp;nbsp; It is an LL(*) parser framework that lets you define the grammar right in C#.&amp;nbsp; Here is what a sample grammar production looks like:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:x-small;"&gt;codeExpression.Production = @expressionStart + @expressionText[&amp;quot;expr&amp;quot;] + @expressionEnd      &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt; Ast&amp;lt;ExpressionNode&amp;gt;()       &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .SetProperty(n =&amp;gt; n.Value, AstFrom(&amp;quot;expr&amp;quot;));&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This code is defining the grammar rule that makes up a code expression &amp;lt;%= SomeValue %&amp;gt; in a template.&amp;nbsp; It says that there will be an expression start token followed by some expression text and then an expression end token.&amp;nbsp; It is also constructing an AST node for the expression.&amp;nbsp; The parser framework has really helped get our new parser of the ground quickly and I highly recommend it.&lt;/p&gt;
&lt;p&gt;The cool thing about defining a grammar is that if there are errors in the template, you will get much more intuitive error information about what the parser saw and what it was expecting to see.&amp;nbsp; Previously, we pretty much just parsed the template, generated code from it and tried to compile it.&amp;nbsp; Here is an example of how we will be providing much better errors in Generator 6.0.&amp;nbsp; Here is a template that has a missing % at the end of the first line:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:x-small;"&gt;&amp;lt;%@ CodeTemplate Language=&amp;quot;C#&amp;quot; &amp;gt;      &lt;br /&gt;&amp;lt;%= DateTime.Now %&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Here is the error that Generator 5.3 gives:    &lt;br /&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:x-small;"&gt;error CodeSmith0104: You must specify a valid template language.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;And here is the error message that the new parser gives:    &lt;br /&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:x-small;"&gt;Line 2, Char 3: %&amp;gt; expected. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In my next post I will talk about the AST and how we are using the visitor pattern to do transformations on the parsed template content.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;P.S. If you haven&amp;rsquo;t figured it out by now, I&amp;rsquo;m really bad about writing to my blog.&amp;nbsp; Rather than break out the random excuse generator, I&amp;rsquo;m just going to start posting.&amp;nbsp; Happy New Year!&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2011/01/04/codesmith-generator-6-0-template-parser-progress-report-part-1.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2011/01/04/codesmith-generator-6-0-template-parser-progress-report-part-1.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://community.codesmithtools.com/aggbug.aspx?PostID=44691" width="1" height="1"&gt;</description><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/Team+Blog/default.aspx">Team Blog</category><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/CodeSmith+Generator+6-0/default.aspx">CodeSmith Generator 6.0</category></item><item><title>CodeSmith Insight Launch Party</title><link>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2010/09/30/codesmith-insight-launch-party.aspx</link><pubDate>Thu, 30 Sep 2010 22:11:12 GMT</pubDate><guid isPermaLink="false">829aebef-9208-4531-832e-1f916c1e97cb:43589</guid><dc:creator>ejsmith</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/rsscomments.aspx?WeblogPostID=43589</wfw:commentRss><comments>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2010/09/30/codesmith-insight-launch-party.aspx#comments</comments><description>&lt;p&gt;CodeSmith Tools is excited to announce the upcoming release of our new product, CodeSmith Insight, and we would like to invite you to come celebrate! Join us at the Addison Conference Center‎ on Tuesday, October 12th, from 6pm to 9pm, for the:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;CodeSmith Insight Launch Party&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Prizes and Giveaways      &lt;br /&gt;&lt;/u&gt;There will be &lt;strong&gt;over $1,000 in prizes&lt;/strong&gt;, including: Apple iPad, Crucial C300 128GB SSD, a new Microsoft Xbox 360 Slim, Nintendo Wii, and more! Plus all attendees will receive a free CodeSmith Insight T-Shirt, as well as a 50% Lifetime Discount for their CodeSmith Insight subscription!&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Games, Competition, and Food      &lt;br /&gt;&lt;/u&gt;This will be a &lt;strong&gt;Retro Game Party&lt;/strong&gt;. There will be a series of old school arcade machines, including: Tetris, Streetfighter 2, Pac-Man, Mortal Kombat, NBA Jam, Metal Slug, Galaga, and more! High scores will be kept throughout the evening, and at the end of the party the leaders will battle it out for the aforementioned prizes! Also, there will be free pizza and drinks for all attendees.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;What is CodeSmith Insight?      &lt;br /&gt;&lt;/u&gt;CodeSmith Insight is a help desk software with advanced application integration. This means that Insight can handle your email and user feedback, as well as your application errors and crash reports, all from a single convenient location. Insight is useful to anyone who makes software.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Please RSVP at our party website!&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Be sure to visit our website and RSVP if you are coming, as there are a limited number of spots and they are filling up fast! &lt;a href="http://party.codesmithtools.com/"&gt;http://party.codesmithtools.com/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;We hope to see you there,    &lt;br /&gt;The CodeSmith Tools Team&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://community.codesmithtools.com/aggbug.aspx?PostID=43589" width="1" height="1"&gt;</description><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/Insight/default.aspx">Insight</category><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/Party/default.aspx">Party</category></item><item><title>PLINQO at the Dallas .NET Users Group</title><link>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2009/07/07/plinqo-at-the-dallas-net-users-group.aspx</link><pubDate>Tue, 07 Jul 2009 19:23:25 GMT</pubDate><guid isPermaLink="false">829aebef-9208-4531-832e-1f916c1e97cb:36858</guid><dc:creator>Eric J. Smith's Weblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/rsscomments.aspx?WeblogPostID=36858</wfw:commentRss><comments>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2009/07/07/plinqo-at-the-dallas-net-users-group.aspx#comments</comments><description>This Thursday July 9th, Shannon Davidson and Tom DuPont will be talking about PLINQO at the Dallas .NET Users Group at Microsoft&amp;#39;s Las Colinas Office in Irving, Texas. If you are in the area, we would love for you to stop by and see what PLINQO is...(&lt;a href="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2009/07/07/plinqo-at-the-dallas-net-users-group.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://community.codesmithtools.com/aggbug.aspx?PostID=36858" width="1" height="1"&gt;</description><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/CodeSmith/default.aspx">CodeSmith</category><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/Community+News/default.aspx">Community News</category><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/-NET/default.aspx">.NET</category></item><item><title>The NuSoft Framework</title><link>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2007/09/20/the-nusoft-framework.aspx</link><pubDate>Thu, 20 Sep 2007 17:41:00 GMT</pubDate><guid isPermaLink="false">829aebef-9208-4531-832e-1f916c1e97cb:27773</guid><dc:creator>ejsmith</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/rsscomments.aspx?WeblogPostID=27773</wfw:commentRss><comments>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2007/09/20/the-nusoft-framework.aspx#comments</comments><description>&lt;p&gt;&lt;span id="ctl00_ctl00_ctl00_Content_ProjectBaseMain_ProjectMain_wikiSourceLabel"&gt;&lt;span id="ctl00_ctl00_ctl00_Content_ProjectBaseMain_ProjectMain_wikiSourceLabel"&gt;Really nice set of new templates: &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;&lt;a href="http://www.codeplex.com/nusoftframework"&gt;http://www.codeplex.com/nusoftframework&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;em&gt;&amp;quot;The NuSoft Framework is an extensible business and data layer framework. It is built as a set of CodeSmith templates. The templates generate a strongly typed C# domain model based off your SQL 2005 database schemas. Our code framework is a great way to get a custom development project off the ground on the right foot.&amp;quot;&lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://community.codesmithtools.com/aggbug.aspx?PostID=27773" width="1" height="1"&gt;</description></item><item><title>Tips &amp; Tricks: Merge Strategies</title><link>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2007/06/09/tips-amp-tricks-merge-strategies.aspx</link><pubDate>Sun, 10 Jun 2007 04:08:00 GMT</pubDate><guid isPermaLink="false">829aebef-9208-4531-832e-1f916c1e97cb:25110</guid><dc:creator>shannon</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/rsscomments.aspx?WeblogPostID=25110</wfw:commentRss><comments>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2007/06/09/tips-amp-tricks-merge-strategies.aspx#comments</comments><description>&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;font size="3" face="Calibri"&gt;Using merge strategies in CodeSmith enables you to combine both user and machine generated code in a single file.&lt;span&gt;&amp;nbsp; &lt;/span&gt;You can also regenerate the machine generated code while still preserving your custom code modifications.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;font size="3" face="Calibri"&gt;CodeSmith comes with two types of merge strategies out of the box:&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph" style="margin:0in 0in 10pt 0.5in;text-indent:-0.25in;"&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span&gt;&lt;font size="3"&gt;·&lt;/font&gt;&lt;span style="font-family:&amp;#39;Times New Roman&amp;#39;;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;font-size-adjust:none;font-stretch:normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;b&gt;InsertRegion&lt;/b&gt; - Allows you to insert a region of generated code into an otherwise custom code file.&lt;span&gt;&amp;nbsp; &lt;/span&gt;You can modify the code outside of the target region and your changes will be preserved during regeneration while overwriting the contents of the target region.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;table style="border:medium none;margin:auto auto auto 31.1pt;border-collapse:collapse;" class="MsoTableGrid" cellpadding="0" cellspacing="0"&gt;

&lt;tr style="height:19.2pt;"&gt;
&lt;td style="border:1pt solid black;padding:0in 5.4pt;width:415.8pt;height:19.2pt;background-color:transparent;"&gt;&lt;p&gt;&lt;font size="3"&gt;&lt;span style="color:blue;font-family:&amp;#39;Courier New&amp;#39;;"&gt;Public&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt; &lt;span style="color:blue;"&gt;Class&lt;/span&gt; InsertRegionSample&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span style="color:blue;"&gt;Public&lt;/span&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt; SomeCustomMethod()&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span&gt;&lt;/span&gt;&lt;span style="color:green;"&gt;&amp;#39; This is my custom code that I want to&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:green;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;#39; preserve. I can make changes to it and&lt;/font&gt;&lt;/span&gt;&lt;span style="color:green;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;#39; my changes will not be overwritten.&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span style="color:blue;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;#&lt;span style="color:blue;"&gt;Region&lt;/span&gt; &lt;span style="color:maroon;"&gt;&amp;quot;Sample Generated Region&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span&gt;&lt;/span&gt;&lt;span style="color:green;"&gt;&amp;#39; This region will be overwritten during each&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span style="color:green;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:green;"&gt;&amp;#39; template execution.&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span style="color:green;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;#&lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Region&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;font size="3"&gt;&lt;span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;font size="3"&gt;&lt;span style="color:blue;font-family:&amp;#39;Courier New&amp;#39;;"&gt;End&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt; &lt;span style="color:blue;"&gt;Class&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;font size="3" face="Calibri"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoListParagraphCxSpLast" style="margin:0in 0in 10pt 0.5in;text-indent:-0.25in;"&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span&gt;&lt;font size="3"&gt;·&lt;/font&gt;&lt;span style="font-family:&amp;#39;Times New Roman&amp;#39;;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;font-size-adjust:none;font-stretch:normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;b&gt;PreserveRegions&lt;/b&gt; – Allows you to designate multiple regions inside of the file as custom code regions.&lt;span&gt;&amp;nbsp; &lt;/span&gt;You can modify the code inside of these regions and your changes will be preserved during regeneration while the rest of the file will be regenerated.&lt;span&gt;&amp;nbsp; &lt;/span&gt;Any regions whose name matches against the supplied regular expression will be preserved during regeneration.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;table style="border:medium none;margin:auto auto auto 28.1pt;border-collapse:collapse;" class="MsoTableGrid" cellpadding="0" cellspacing="0"&gt;

&lt;tr style="height:239.9pt;"&gt;
&lt;td style="border:1pt solid black;padding:0in 5.4pt;width:418.75pt;height:239.9pt;background-color:transparent;"&gt;&lt;p&gt;&lt;span style="font-size:10pt;color:blue;font-family:&amp;#39;Courier New&amp;#39;;"&gt;Public&lt;/span&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Courier New&amp;#39;;"&gt; &lt;span style="color:blue;"&gt;Class&lt;/span&gt; PreserveRegionsSample&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; #&lt;span style="color:blue;"&gt;Region&lt;/span&gt; &lt;span style="color:maroon;"&gt;&amp;quot;Custom Region 1&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:maroon;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:10pt;color:maroon;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;span style="color:green;"&gt;&amp;#39; This is my custom code that I want to preserve.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;span style="color:green;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:green;"&gt;&amp;#39; I can make changes to it and my changes will&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:green;"&gt;&amp;#39; not be overwritten.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:green;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:10pt;color:green;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Courier New&amp;#39;;"&gt;#&lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Region&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:10pt;color:blue;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;span style="color:blue;"&gt;Public&lt;/span&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt; SomeGeneratedMethod()&lt;/span&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&lt;/span&gt; 
&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal;"&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:green;"&gt;&amp;#39; This section and all other regions that do not&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal;"&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;span style="color:green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39; match the region name regular expression that you&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal;"&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;span style="color:green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39; supply to the merge strategy&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:green;font-family:&amp;#39;Courier New&amp;#39;;"&gt;will be overwritten&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal;"&gt;&lt;span style="font-size:10pt;color:green;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39; during each&lt;/span&gt;&lt;span style="font-size:10pt;color:green;font-family:&amp;#39;Courier New&amp;#39;;"&gt; template execution.&amp;nbsp;In this sample, &lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal;"&gt;&lt;span style="font-size:10pt;color:green;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39; the regular expression being used matches any region&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal;"&gt;&lt;span style="font-size:10pt;color:green;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39; who&amp;#39;s name starts with &amp;quot;Custom&amp;quot;.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:10pt;color:green;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;span&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;span style="color:blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:blue;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Courier New&amp;#39;;"&gt;#&lt;span style="color:blue;"&gt;Region&lt;/span&gt; &lt;span style="color:maroon;"&gt;&amp;quot;Custom Region 2&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:maroon;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:10pt;color:maroon;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;span style="color:green;"&gt;&amp;#39; The contents of this region will also be preserved&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:green;"&gt;&amp;#39; during generation.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;color:green;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:10pt;color:green;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; #&lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Region&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:10pt;color:blue;font-family:&amp;#39;Courier New&amp;#39;;"&gt;End&lt;/span&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Courier New&amp;#39;;"&gt; &lt;span style="color:blue;"&gt;Class&lt;/span&gt;&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;font size="3" face="Calibri"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoListParagraphCxSpLast" style="margin:0in 0in 10pt 0.5in;text-indent:-0.25in;"&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span&gt;&lt;font size="3"&gt;·&lt;/font&gt;&lt;span style="font-family:&amp;#39;Times New Roman&amp;#39;;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;font-size-adjust:none;font-stretch:normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;b&gt;IMergeStrategy &lt;/b&gt;– Allows you to implement your own merging logic.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;font size="3" face="Calibri"&gt;The attached samples show an example of using both kinds of merge strategies as well as a CodeSmith Project file to execute them.&lt;span&gt;&amp;nbsp; &lt;/span&gt;Simply, right click on the MergeSamples.csp file and select Generate Outputs to regenerate.&amp;nbsp; You can also see the merge settings being used by right-clicking the MergeSamples.csp, selecting Manage Outputs, and then clicking edit on each output to see the settings.&lt;/font&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://community.codesmithtools.com/aggbug.aspx?PostID=25110" width="1" height="1"&gt;</description><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/CodeSmith+4-0/default.aspx">CodeSmith 4.0</category><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/Tips+_2600_amp_3B00_+Tricks/default.aspx">Tips &amp;amp; Tricks</category></item><item><title>CodeSmith 4.0 Released</title><link>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2006/11/08/codesmith-4-0-released.aspx</link><pubDate>Wed, 08 Nov 2006 19:11:00 GMT</pubDate><guid isPermaLink="false">829aebef-9208-4531-832e-1f916c1e97cb:25161</guid><dc:creator>Eric J. Smith's Weblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/rsscomments.aspx?WeblogPostID=25161</wfw:commentRss><comments>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2006/11/08/codesmith-4-0-released.aspx#comments</comments><description>CodeSmith 4.0 has been officially released today at the Dev Connections conference in Las Vegas! This is a huge release for us and has a bunch of great new features as well as countless minor enhancements and bug fixes all based on customer feedback....(&lt;a href="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2006/11/08/codesmith-4-0-released.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://community.codesmithtools.com/aggbug.aspx?PostID=25161" width="1" height="1"&gt;</description><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/General/default.aspx">General</category><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/CodeSmith/default.aspx">CodeSmith</category><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/General+Software+Development/default.aspx">General Software Development</category><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/Community+News/default.aspx">Community News</category><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/-NET/default.aspx">.NET</category></item><item><title>CodeSmith 4.0 Public Beta Released</title><link>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2006/10/19/codesmith-4-0-public-beta-released.aspx</link><pubDate>Fri, 20 Oct 2006 00:53:00 GMT</pubDate><guid isPermaLink="false">829aebef-9208-4531-832e-1f916c1e97cb:25163</guid><dc:creator>Eric J. Smith's Weblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/rsscomments.aspx?WeblogPostID=25163</wfw:commentRss><comments>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2006/10/19/codesmith-4-0-public-beta-released.aspx#comments</comments><description>CodeSmith 4.0 Beta 2 has been released and is now available to the public. Here are just a few the new capabilities in CodeSmith 4.0: CodeSmith Projects (.csp) - This feature makes automating your code generation process really easy and consistent whether...(&lt;a href="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2006/10/19/codesmith-4-0-public-beta-released.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://community.codesmithtools.com/aggbug.aspx?PostID=25163" width="1" height="1"&gt;</description><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/CodeSmith/default.aspx">CodeSmith</category><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/General+Software+Development/default.aspx">General Software Development</category><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/Community+News/default.aspx">Community News</category><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/tags/-NET/default.aspx">.NET</category></item><item><title>CodeSmith $5,000 cash give away at Dev Connections</title><link>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2006/10/07/codesmith-5-000-cash-give-away-at-dev-connections.aspx</link><pubDate>Sat, 07 Oct 2006 21:57:00 GMT</pubDate><guid isPermaLink="false">829aebef-9208-4531-832e-1f916c1e97cb:25165</guid><dc:creator>Eric J. Smith's Weblog</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/rsscomments.aspx?WeblogPostID=25165</wfw:commentRss><comments>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2006/10/07/codesmith-5-000-cash-give-away-at-dev-connections.aspx#comments</comments><description>CodeSmith will have a booth at Dev Connections in Las Vegas next month and we thought it would be a lot of fun to give away some gambling money! If you are coming to Dev Connections, just make sure to stop by our booth and signup. If you aren&amp;#39;t coming...(&lt;a href="http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2006/10/07/codesmith-5-000-cash-give-away-at-dev-connections.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://community.codesmithtools.com/aggbug.aspx?PostID=25165" width="1" height="1"&gt;</description></item><item><title>XML-based Code Generation with CodeSmith</title><link>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2006/05/22/13874.aspx</link><pubDate>Mon, 22 May 2006 20:23:00 GMT</pubDate><guid isPermaLink="false">829aebef-9208-4531-832e-1f916c1e97cb:13874</guid><dc:creator>ejsmith</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/rsscomments.aspx?WeblogPostID=13874</wfw:commentRss><comments>http://community.codesmithtools.com/CodeSmith_Community/b/ericjsmith/archive/2006/05/22/13874.aspx#comments</comments><description>&lt;P&gt;&lt;A href="http://www.larkware.com/"&gt;Mike Gunderloy&lt;/A&gt; has just posted a new article about &lt;A href="http://developer.com/xml/article.php/10929_3525776_1"&gt;XML-based Code Generation with CodeSmith&lt;/A&gt;&amp;nbsp;over at &lt;A href="http://www.developer.com/"&gt;Developer.com&lt;/A&gt;.&amp;nbsp; Mike does a great job of explaining the new XmlProperty feature in CodeSmith and how powerful it can be in using XML as metadata for your templates.&lt;/P&gt;&lt;img src="http://community.codesmithtools.com/aggbug.aspx?PostID=13874" width="1" height="1"&gt;</description></item></channel></rss>

