示例#1
0
 public void VisitClass(ClassDef c)
 {
     w.Write("class");
     w.Write(" ");
     w.Write(c.name.Name);
     if (c.args != null && c.args.Count > 0)
     {
         w.Write("(");
         w.Write(string.Join(",", c.args.Select(e => e.ToString())));
         w.Write(")");
     }
     w.WriteLine(":");
     ++w.IndentLevel;
     c.body.Accept(this);
     --w.IndentLevel;
 }
示例#2
0
 public void VisitDecorated(Decorated d)
 {
     foreach (var dec in d.Decorations)
     {
         w.Write("@");
         w.Write(dec.className.ToString());
         w.Write("(");
         var sep = "";
         foreach (var arg in dec.arguments)
         {
             w.Write(sep);
             sep = ", ";
             arg.Write(writer);
         }
         w.Write(")");
         w.WriteLine();
     }
     d.Statement.Accept(this);
 }