public override void Visit(MultiplyExpressionNode node) { node.expression1.Accept(this); Gen("push", "eax"); node.expression2.Accept(this); Gen("pop", "edx"); Gen("imul", "eax", "edx"); }
public override void Visit(MultiplyExpressionNode node) { node.expression1.Accept(this); node.expression2.Accept(this); if (!AreTypeCompatible(node.expression1.ExpressionType.GetType(), typeof(IntType))) throw new Exception("Expression 1 for * operation is not of type Int!"); if (!AreTypeCompatible(node.expression2.ExpressionType.GetType(), typeof(IntType))) throw new Exception("Expression 2 for * operation is not of type Int!"); node.ExpressionType = IntType.Instance; }
public virtual void Visit(MultiplyExpressionNode node) { node.expression1.Accept(this); node.expression2.Accept(this); }
public override void Visit(MultiplyExpressionNode node) { Console.WriteLine(this.indentation + "*"); indentation = indentation + " "; node.expression1.Accept(this); node.expression2.Accept(this); indentation = indentation.Substring(0, indentation.Length - 3); }