//-----------<Test Stub>-------- static void main(string[] args) { Console.WriteLine("\nTesting the IntegerElement class"); Console.WriteLine("\n================================\n"); IntegerElement int_elem = new IntegerElement(); string val = "3"; int_elem.setText(val); Console.WriteLine("{0} The Integer element is:", int_elem.getText()); }
public override void VisitIntegerElement(IntegerElement element){ string text = element.getText(); if (text.Contains(",")) { string[] inputs = text.Split(','); if (mList.Count != 0) { mList.Clear(); } foreach (string input in inputs) { mList.Add(int.Parse(input)); } } else { int element_value = int.Parse(text); mStack.Push(element_value); } }
//-----------<Test Stub>-------- static void main(string[] args) { Console.WriteLine("\nTesting the AssignmentOperationElement class"); Console.WriteLine("\n==========================================\n"); AssignmentOperationElement elem_assign = new AssignmentOperationElement(); IntegerElement int_elem = new IntegerElement(); VariableElement var_elem = new VariableElement(); string lhsval = "a"; string rhsval = "3"; VariableElement lhs = var_elem; Element rhs = int_elem; int_elem.setText(rhsval); var_elem.setText(lhsval); elem_assign.setLhs(lhs); elem_assign.setRhs(rhs); var_elem=elem_assign.getLhs(); int_elem = (IntegerElement)elem_assign.getRhs(); Console.WriteLine("{0} The element at Lhs is:", int_elem.getText()); Console.WriteLine("{0} The element at the rhs is:", var_elem.getText()); }
public override void VisitIntegerElement(IntegerElement element) { Console.Write("int:" + element.getText() + " "); }
public override void VisitIntegerElement(IntegerElement element) { resultMessage += "Visiting Integer Element"+"\n"; int element_value = int.Parse(element.getText()); mStack.Push(element_value); }
public override void VisitIntegerElement(IntegerElement element) { int element_value = int.Parse(element.getText()); mStack.Push(element_value); }
private void PerformIntMultiplication(Object obj_rhs, Object obj_lhs) { try { IntegerElement stk_rhs = (IntegerElement)(obj_rhs); IntegerElement stk_lhs = (IntegerElement)(obj_lhs); IntegerElement final = new IntegerElement(); if (stk_lhs != null && stk_rhs != null) { int temp_lhs = int.Parse(stk_lhs.getText()); int temp_rhs = int.Parse(stk_rhs.getText()); final.setText((temp_lhs * temp_rhs).ToString()); Object result = (Object)(final); mat_stack.Push(result); Console.Write("Product: " + final.getText()); } } catch (Exception e) { sendres(112, "Unassigned variables\n"); e.GetType(); }; }
//public override void VisitMatrixOperationElement(MatrixOperationElement element) { } public override void VisitIntegerElement(IntegerElement element) { if (inParallelFor == 1) { intData(element.getText()); parallelString.Append(element.getText()); } else { mat_stack.Push(element); } }
//public override void VisitMatrixOperationElement(MatrixOperationElement element) { } public override void VisitIntegerElement(IntegerElement element) { Console.Write("Int Value:" + element.getText()); interp.sendres(114, "Int Value:" + element.getText()); }
public void setLowRange(IntegerElement e) { lowbound = int.Parse(e.getText()); }
public void setHighRange(IntegerElement e) { uppbound = int.Parse(e.getText()); }
public void addElement(IntegerElement item) { rowElements.Add(Int32.Parse(item.getText())); }