[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnucap-devel] prototype name -- bug or feature?
From: |
Felix Salfelder |
Subject: |
Re: [Gnucap-devel] prototype name -- bug or feature? |
Date: |
Fri, 25 Jan 2013 16:58:24 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Thu, Jan 17, 2013 at 09:52:15PM +0100, Felix Salfelder wrote:
> i don't know. but is this a verilog issue? potentially some or other
> language plugin might want to (dis)allow bogus declarations, so
> find_looking_out should make it optional. i think, optionally just
> returning cards if !is_device(), would at least solve my problem.
while i'm at it: i've now implemented
const CARD* find_card(string name, CARD_LIST* Scope, bool nondevice=0);
in LANGUAGE as follows.
const CARD* LANGUAGE::find_card(string name, CARD_LIST* Scope, bool nondevice) {
if (!Scope) Scope = &CARD_LIST::card_list;
CARD_LIST::const_iterator i = Scope->find_(name);
if(nondevice){
while (i!=Scope->end()) {
if((*i)->is_device()){ untested();
i = Scope->find_again(name, ++i); // skip
} else {
break;
}
}
}
if (i == Scope->end()) {
throw Exception_Cant_Find(name, "scope");
}
return *i;
}
i've changed the find_ call in LANGUAGE::find_proto to
try {
p = find_card( Name, &CARD_LIST::card_list, !OPT::bogus );
} catch(Exception_Cant_Find) {
assert(!p);
}
if there's really a language that does conditional bogus instanciations,
nondevice needs to be changed to prefer_nondevice... i'll leave it like
this for now.
have fun
felix