public override object VisitProgNode(ProgNode n) { var globdefs = new List <ASTNode>(n.children.Count); var enumdefs = new List <ASTNode>(n.children.Count); var structdefs = new List <ASTNode>(n.children.Count); var fundefs = new List <ASTNode>(n.children.Count); var rest = new List <ASTNode>(n.children.Count); foreach (var c in n.children) { switch (c.kind) { case ASTKind.GlobalVarDef: globdefs.Add(c); break; case ASTKind.EnumDef: enumdefs.Add(c); break; case ASTKind.StructDef: structdefs.Add(c); break; case ASTKind.FunDef: fundefs.Add(c); break; default: rest.Add(c); break; } } foreach (ASTNode c in globdefs) { Visit(c); } foreach (ASTNode c in enumdefs) { Visit(c); } foreach (ASTNode c in structdefs) { Visit(c); } foreach (ASTNode c in fundefs) { Visit(c); } foreach (ASTNode c in rest) { Visit(c); } return(null); }
public virtual T VisitProgNode(ProgNode n) { foreach (var c in n.children) { Visit(c); } return(default(T)); }
public object VisitProgNode(ProgNode n) { WriteLine(n.kind); Indent(); foreach (ASTNode c in n.children) { Visit(c); } Dedent(); return(null); }
public override MIPSRegister VisitProgNode(ProgNode n) { return(base.VisitProgNode(n)); }
public override LLVMRegister VisitProgNode(ProgNode n) { throw new NotImplementedException(); }