/*************************************************************************** attributeref.cpp - description ------------------- begin : Thu Mar 20 20:35:28 2003 copyright : (C) 2002 by Cavalli Andrea email : cavalli@bioc.unizh.ch **************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include #include AttributeRef::~AttributeRef(){ delete primary; delete identifier; } ZObj * AttributeRef::eval(){ //exec_line done exec_line = line; ZObj * obj = primary->eval(); string id = ((Identifier*)identifier)->val; if(obj->has_attribute()){ ZObj * res = obj->attribute(id); // cout<<"DEBUG attr "<type()<type().name()) +" does not have attribute "+ id); if(bind->has_attribute()){ ZObj * res = bind->attribute(id); ZObj::remove(obj); ZObj::remove(bind); return res; } throw ZError(line, "Object " + to_string(obj->type().name()) +" does not have attribute "+ id); } void AttributeRef::check(){ primary->check(); identifier->check(); Almost::aout<<"ATR \n"; }