help-bison
[Top][All Lists]
Advanced

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

bison problem: Aborted (core dumped)


From: Catharina Ibrahim
Subject: bison problem: Aborted (core dumped)
Date: Mon, 1 Nov 2004 03:56:54 -0800 (PST)

Hi all,

I have a spinning head trying to get Bison to work. It
costs me 1.5 days already and I'm really at the end of
my sanity. Pls help :)

I use Bison version 1.875 with cygwin. The following
is the file tryBison.y (basically contains example in
the manual from gnu.org):

-------------

%{
#define YYSTYPE double
#include <math.h>
%}

%token NUM

%%

exp: NUM { $$ = $1; }
        | exp exp '+' { $$ = $1 + $2; }
;

%%

int yylex (void)
{
        int c = 0;

        /* skip white space  */
        while ((c = getchar ()) == ' ' || c == '\t')
        ;

        /* process numbers   */
        if (c == '.' || isdigit (c))
        {
          ungetc (c, stdin);
          scanf ("%lf", &yylval);
          return NUM;
        }

        /* return end-of-file  */
        if (c == EOF)
        return 0;

        /* return single chars */
        return c;
}

int main (void)
{
        return yyparse ();
}

-----------------------------

in cygwin:
$ bison tryBison.y
Aborted (core dumped)

I can't figure out what's wrong. Plz help.

thx in advance,
cath


                
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 




reply via email to

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