Beispiel #1
0
 protected override void VisitRule(IRule rule)
 {
     CS.Ln($"// {rule.Identifier} -> {Cfg.CU(rule.Identifier)}");
     CS.Block($"protected virtual {Cfg.IResult} {Cfg.CU(rule.Identifier)}({Cfg.IContext} {Cfg.CtxName})", () =>
     {
         Locals.Reset();
         using (Locals.PrepareResult())
         {
             CS.Ln($"var {Cfg.CurName} = {Cfg.CtxName};");
             VisitExpression(rule.Expression);
             CS.Ln($"return {Cfg.FinishRule}({Locals.Result}, \"{CharRep.InCSharp(rule.Identifier.Name)}\");");
         }
     });
 }