collapsing nodes. was: Re: Summer of code: Gschem analysis for parsing

Felix Salfelder <[email protected]>
Newsgroups gmane.comp.gnu.gnucap.devel
Message-ID <[email protected]>
On Wed, May 16, 2012 at 11:06:14PM -0400, al davis wrote:
> or eventually with the right model compiler:
> 
> module net(pin1,pin2);
>   output pin1,pin2;
>   electrical pin1,pin2;
>   analog
>     V(pin1,pin2) <+ 0;
> endmodule

i was wondering, how this can be implemented. it seems to me, that
something similar to

void node_t::collapse(CARD* d, string to)
{
  assert(d);

  NODE_MAP* Map = d->scope()->nodes();
  assert(Map);
  NODE* targetnode = dynamic_cast<NODE*>((*Map)[to]);
  if (_nnn._user_number != targetnode._user_number){
    collapsed_nodes.push_back(_nnn._user_number);
    _nnn._user_number = targetnode._user_number;
  }
}

needs to be added to the node interface (where collapsed_nodes must be taken
care of later during node allocation/mapping).

depending on how involved this is, i might give it a try. collapsing
zero resistors would be fine anyway. am i missing something?

regards
felix
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.