[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: SegFault on yyparse()
From: |
Gautam Kapoor |
Subject: |
RE: SegFault on yyparse() |
Date: |
Thu, 30 May 2013 12:33:08 +0530 |
Hi Charlie,
YYLEX is a macro. It is making a call to the scanner to get the next token. I
don't think "assigning to yychar" is causing the segfault. Please put a
breakpoint into yylex() function and see where it is crashing.
Let us see the code snippet inside yylex() function to make out why the error
occurs.
In a newer version of bison/flex, and depending on my other flags, I see this:
/* Read a lookahead token. */
if (yychar == yyempty_)
{
YYCDEBUG << "Reading a token: ";
yychar = yylex (&yylval, &yylloc);
}
-regards
Gautam
-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Charlie Lacroix
Sent: Wednesday, May 29, 2013 1:18 PM
To: address@hidden
Subject: SegFault on yyparse()
Hi,
I am a beginner with Flex/Bison tools. At my work, we have a project,
which contains bison files. It is an old version of bison : 2.3 ; and
an old version of Flex : 2.5.4. It compiles on this version, but on my
personal computer (with one of the last version of bison and flex), I
have a segmentation fault.
I used gdb to understand why, and the segfault appears on yyparse in
bla.tab.c, on the line below :
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
--> yychar = YYLEX;
}
I really don't understand why it works at my work, and not on my computer...
Can somebody help me? (sorry if I do not speak very well, I am a french ^^')
Thanks!
Best regards
Charlie Lacroix
_______________________________________________
address@hidden https://lists.gnu.org/mailman/listinfo/help-bison