Пример #1
0
 virtual public void class_declaration(class_declaration ast, int indent)
 {
     EmitattributeSectionList(ast.attrs, indent);
     EmitModifiers(ast.mods, indent, " ");
     Write("class {0}", ast.id.str);
     if (ast.bases.Count > 0)
     {
         Write(": ");
         visit(ast.bases[(0)]);
         for (int i = 1; i < ast.bases.Count; i++)
         {
             Write(", ");
             visit(ast.bases[(i)]);
         }
     }
     WriteLine(" {{");
     foreach (declaration d in ast.body)
     {
         if (IsPublic(d.mods))
         {
             visit(d, indent + 1);
         }
     }
     WriteLine("}}", indent);
 }
Пример #2
0
 void class_declaration(class_declaration ast, ArrayList list)
 {
     list.Add(new Pair(ast.id.str, ast));
     list = new ArrayList();
     foreach (declaration x in ast.body)
     {
         declaration(x, list);
     }
     ast.body = Sort(list);
 }
Пример #3
0
 public virtual void class_declaration(class_declaration ast)
 {
     declarationList(ast.body);
 }