> Hello, > > I am trying to make a glr parser with bison version 2.0 > But the generated code ends up in an infinite loop in the > yymergeOptionSets function. After looking at that code I see > that it is iterating over a yysemanticOption linked list that > ends with a NULL. > But it never reaches NULL because at some point the > "current pointer" and "next pointer" are the same so the statement > yyz = yyz->next continues for ever.
I will try to take a look at this soon. Yes, it would help quite a bit if you could send a reproducer as well. There is no particular need to spend a lot of time cutting it down; the most important thing is to send enough enough code, data (and instructions) to reproduce the loop. > #if (! defined (YYSTACKEXPANDABLE) \ > && (! defined (__cplusplus) \ > || (defined (YYLTYPE_IS_TRIVIAL) && YYLTYPE_IS_TRIVIAL \ > && defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) > #define YYSTACKEXPANDABLE 1 > #else > #define YYSTACKEXPANDABLE 0 > #endif > > Could the semantic differences between C and C++ also be a problem here? Anything is possible, but probably not in this particular area. If the stack can't be expanded, the parser errors out. Paul Hilfinger
