public override void Visit(NewObjectExpressionNode node) { ClassDefinition newClassDefinition = Analysis.Environment.Classes.Lookup(node.identifier.name); Gen("push", "ecx"); Gen("push", (newClassDefinition.SizeInBytes + 4).ToString(), "", "Instantiating class " + newClassDefinition.Name); Gen("call", "memalloc"); Gen("add", "esp", "4"); Gen("pop", "ecx"); Gen("lea", "edx", newClassDefinition.Name + "$$"); Gen("mov", "[eax]", "edx"); }
public override void Visit(NewObjectExpressionNode node) { ClassDefinition definiton = Analysis.Environment.Classes.Lookup(node.identifier.name); if (definiton == null) throw new Exception("No class definition exists for '" + node.identifier.name + "'!"); node.ExpressionType = definiton.ClassType; }
public virtual void Visit(NewObjectExpressionNode node) { }
public override void Visit(NewObjectExpressionNode node) { Console.WriteLine(this.indentation + "New Object <Class: " + node.identifier.name + ">"); }