[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: gschem hangs on a symbol



Hi John,

On Friday 19 May 2006 19:14, John Coppens wrote:
> On Sun, 14 May 2006 14:04:28 +0200 Werner Hoch wrote:
> >
> > Recursion makes short and powerful programs.
>
> Yes... But the symbol definition language doesn't have conditional
> constructs, does it? 

No, but gschem uses recursive functions to draw the symbol.
If there are symbols that creates recursion loops, gschem dies.
e.g.
Symbol A contains symbol A

or
symbol A contains symbol B
symbol B contains symbol A

> So how can one get out of a recursion? 

* count the recursion level. print an error message (and stop) if the 
recursion is to deep.
* check all parent objects before entering next recursion level.

> > In future there may be (will be) support for symbol inheritance.
> > http://archives.seul.org/geda/dev/Oct-2005/msg00043.html
>
> Inheritance seems way more logical. Symbols are passive objects... Or
> maybe we could even make them active (methods), so we need only one
> DIP component, one SIP...

Inheritance is intented to create heavy symbols:
e.g.
the device 2N2222 could contain:
  a transistor symbol
  a footprint attribute
  a spice model attribute
  a documentation attribute

The basic transistor symbol could be reused for many transistor devices.

regards
Werner