CodeSmith Generator 6.0 Template Parser Progress Report - Part 2
Posted by: Eric J. Smiths Weblog,
on 02 Feb 2011 |
View original | Bookmarked: 0 time(s)
In this post Im going to talk about how the new template parser in CodeSmith Generator 6.0 creates an AST (Abstract Syntax Tree) and then uses the visitor pattern to iterate over the nodes in the AST and do transformations. The grammar rules I talked about in my previous post are used to both validate the syntax of the template code and to create typed AST nodes. Here is a very simple template: <%@ CodeTemplate Language="C#" %> <%= DateTime.Now %> The resulting...