public override void VisitAdditionOperationElement(AdditionOperationElement element)
 {
     VisitElement(element.getLhs());
     Console.Write("+ ");
     VisitElement(element.getRhs());
     Console.Write(" ");
 }
Example #2
0
 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);    
 }
Example #3
0
 //----< 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);
 }
Example #5
0
 public abstract void VisitAdditionOperationElement(AdditionOperationElement element);