//-----------<Test Stub>-------- static void main(string[] args) { Console.WriteLine("\nTesting the DeleteVariable class"); Console.WriteLine("\n================================\n"); DeleteVariable elem_del = new DeleteVariable(); VariableElement var_elem = new VariableElement(); string value = "a"; var_elem.setText(value); elem_del.setVar(var_elem); VariableElement element = elem_del.getVar(); Console.WriteLine("{0} The expression of class is: delete", element.getText()); }
public override void VisitDeleteElement(DeleteVariable element) { Console.Write("delete "); VisitElement(element.getVar()); Console.Write(";\n"); }
public abstract void VisitDeleteElement(DeleteVariable element);
/*public override void VisitDeclarationElement(DeclarationElement element) { //throw new NotImplementedException(); }*/ //Delete from symbol table public override void VisitDeleteElement(DeleteVariable element) { if (mVariableMap.ContainsKey(element.getVar().getText())) mVariableMap.Remove(element.getVar().getText()); else { sendres(112, "Variable not declared, cannot be deleted\n"); } }
/*public override void VisitDeclarationElement(DeclarationElement element) { //throw new NotImplementedException(); }*/ //Delete from symbol table public override void VisitDeleteElement(DeleteVariable element) { }