gnucap-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnucap-devel] infinite loop in spice parser


From: Felix Salfelder
Subject: Re: [Gnucap-devel] infinite loop in spice parser
Date: Sat, 30 Mar 2013 14:22:56 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

On Fri, Mar 29, 2013 at 08:15:02PM -0400, al davis wrote:
> The usual gnucap way to handle that would be:
> 
>     unsigned here = cmd.cursor();
>     cmd >> node_name;
>     if (cmd.stuck(&here)) {

> your way works too.

because "here" has been pushed back already... "stuck" is more elegant,
of course.

> Having opened this one up .. What does Spice (NGspice?) do?
> How does Spice (any of them) handle a semicolon?
> What should it do?

i dont know, couldnt find a spice syntax definition.

> Does that spice use a semicolon to introduce a comment?

if net contains

C1 1 2 3
C2 1 2 3;
C3 1 2 3; commnt

i get
$ ngpice net
ngspice 1 -> listing


     1 : 
     2 : c1 1 2 3
     3 : c2 1 2 3
     4 : c3 1 2 3
     5 : .end

> It seems to me that perhaps the semicolon should be treated as 
> "end of statement".
> [..]
>  so perhaps ...
>     }else if (cmd.skip1b(';') || cmd.is_end()) {

i think "start of comment" won't hurt. but then CS::get_line would be
the place to handle it, right?

> It still needs the check for "stuck".

not the proposed one, it breaks subcircuits without ports. i'd guess they
should be allowed. :|

regards
felix



reply via email to

[Prev in Thread] Current Thread [Next in Thread]