public override void VisitAdditionOperationElement(AdditionOperationElement element) { VisitElement(element.getLhs()); Console.Write("+ "); VisitElement(element.getRhs()); Console.Write(" "); }
public override void VisitAdditionOperationElement(AdditionOperationElement element){ VisitElement(element.getLhs()); VisitElement(element.getRhs()); int rhs = mStack.Pop(); int lhs = mStack.Pop(); int result = rhs + lhs; mStack.Push(result); }
//----< visit Addition Operation >------------------------------ public override void VisitAdditionOperationElement(AdditionOperationElement element) { VisitElement(element.getLhs()); VisitElement(element.getRhs()); int rhs = int.Parse(mIntStack.Pop().getText()); int lhs = int.Parse(mIntStack.Pop().getText()); IntegerElement result = new IntegerElement(); result.setText((lhs + rhs).ToString()); mIntStack.Push(result); }
public override void VisitAdditionOperationElement(AdditionOperationElement element) { VisitElement(element.getLhs()); VisitElement(element.getRhs()); resultMessage += "performing addition operation on scalar"+"\n"; int rhs = mStack.Pop(); int lhs = mStack.Pop(); int result = rhs + lhs; mStack.Push(result); }