internal CompilationState(RoslynIntrospector introspector, HandlebarsTemplate template)
 {
   Introspector = introspector;
   Template = template; 
   if (!(template is StaticHandlebarsTemplate))
   {
     INamedTypeSymbol modelSymbol = Template.ModelFullyQualifiedName.Evaluate(Introspector);
     if (modelSymbol == null)
       Errors.Add(new HandlebarsTypeError($"Could not find Type in ModelToken '{Template.ModelFullyQualifiedName}'!", HandlebarsTypeErrorKind.UnknownViewModel, 1, 1));
     ContextStack.Push(new Context("viewModel", modelSymbol));
   }
   resultStack.Push(new List<StatementSyntax>());      
 }
 public void VisitLeave(HandlebarsTemplate template)
 {
     state.PushStatement(SyntaxHelper.ReturnSBToString);
       resultingCompilationUnit = state.GetCompilationUnitHandlebarsTemplate();
 }
 public void VisitEnter(HandlebarsTemplate template)
 {
     state.PushStatement(SyntaxHelper.DeclareAndCreateStringBuilder);
 }
 public CodeGenerationVisitor(RoslynIntrospector introspector, HandlebarsTemplate template)
 {
     state = new CompilationState(introspector, template);
       state.Introspector = introspector;
 }