compiler/LexTest/AST.cpp
//search for variable in the current method locals

search for variable in the current method locals
search for variable in the current method locals
bool ID_Node::searchMethodLocal(list <Variable*> Local,char *name,Variable*& locate)
{
	if (Local.empty())
		return false;
	bool ok=false;
	std::list<Variable*>::const_iterator i=Local.begin();
	while ((i!=Local.end())&&(!ok))
	{
		Variable*u=(Variable*)*i;
		if (strcmp(u->name,name)==0)
		{
			locate=u;
			ok=true;
		}
		i++;
	}
	return ok;
}
bool ID_Node :: searchMethodLocal ( list < Variable * > Local , char * name , Variable * & locate ) { if ( Local . empty ( ) ) return false ; bool ok = false ; std :: list < Variable * > :: const_iterator i = Local . begin ( ) ; while ( ( i != Local . end ( ) ) && ( ! ok ) ) { Variable * u = ( Variable * ) * i ; if ( strcmp ( u -> name , name ) == 0 ) { locate = u ; ok = true ; } i ++ ; } return ok ; }
search for variable in the current method locals
search for variable in the current method locals