help-bison
[Top][All Lists]
Advanced

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

Re: bison2.4.1 perhaps has a bug under winxp platform.


From: Joel E. Denny
Subject: Re: bison2.4.1 perhaps has a bug under winxp platform.
Date: Mon, 8 Feb 2010 11:04:42 -0500 (EST)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)

On Mon, 8 Feb 2010, Supervisor Root wrote:

> I used bison2.4.1,

Okay.

> yacc1.9.1

We only support Bison here.

> and flex2.5.4

Flex 2.5.4 is very old.  I'm using Flex 2.5.34 at the moment.  However, 
off the top of my head, I don't see how updating would address your 
problem.

> to create a simple parser 
> under windows XP platform, but I found that yyparse return zero when 
> syntax is error, this is or not a bug?

> condition: TRUE
>  |  FALSE
>  |  error {}
>  ;

The last production here allows the parser to enter error recovery mode.  
If it recovers and then completes the parse successfully, then it returns 
0.

>  if (nRet == 0)
>  {
>   printf("This is a corrent program!\n");
>  }
>  else
>  {
>   printf("This is a incorrent program!\n");
>  }

It sounds like you want to check nRet == 0 && yynerrs == 0.

> In addition, the parser runs normal under linux platform. (yyparse 
> returns non-zero under linux platform

I just tried your original code and example input on linux (Ubuntu 8.04), 
and yyparse returned zero.




reply via email to

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