[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: parser stack overflow, bug in glr??
From: |
Roger Casaponsa |
Subject: |
Re: parser stack overflow, bug in glr?? |
Date: |
Sat, 30 Jul 2005 21:26:00 +0200 |
User-agent: |
Mozilla Thunderbird 1.0.2 (X11/20050419) |
ok, here is a "new version" I have take out all the ast construction, I
think now it will work.
the input is the same:
a a::b(){}
d c;
The interesting lines now are in the file err:
line 326 (after shifting token '}' and we have only 2 stacks (stack 0
and stack 1)):
Reduced stack 0 by rule #9; action deferred. Now in state 2.
Stack 0 Entering state 2
Reading a token: Next token is token IDENTIFIER ()
then it split stacks 0 and 2:
line 329: Splitting off stack 2 from 0.
line 332: Splitting off stack 3 from 2.
line 339: Splitting off stack 4 from 0.
line 342: Splitting off stack 5 from 4.
and finaly in line 348 it deals with stack 1:
Stack 1 Entering state 40
Reduced stack 1 by rule #24; action deferred. Now in state 8.
Stack 1 Entering state 8
Reduced stack 1 by rule #12; action deferred. Now in state 3.
Stack 1 Entering state 3
Reduced stack 1 by rule #9; action deferred. Now in state 2.
Merging stack 1 into stack 0.
here merges stack 1 into 0 in state 2, before splitting stack 0.
thanks for all
Roger
Paul Eggert wrote:
>Roger Casaponsa <address@hidden> writes:
>
>
>
>>I don't know what files you need. I attach all the files, sorry if it's
>>too much.
>>
>>
>
>It's good to attach all files, but unfortunately your email contained
>just a concatenation of the files, without any indication of where one
>stopped and another started.
>
>I attempted to reconstruct the test case, and attach the result as a
>gzipped tar file. I have problems when trying to reproduce the
>problem, though, as shown in the following transcript. I am using CVS
>Bison, flex 2.5.31 (Debian GNU/Linux 3.1), and GCC 4.0.1. Perhaps the
>diagnostics I'm seeing might help you explain your problem, or it's
>possible that I just haven't created the test case correctly.
>
>$ make
>flex c++98.l
>bison --verbose --yacc --defines --debug --report=all c++98.y
>2 rules never reduced
>c++98.y: warning: 1 useless nonterminal and 2 useless rules
>c++98.y:36.27-45: warning: useless nonterminal: declaration_seq_opt
>c++98.y:95.17-27: warning: useless rule: declaration_seq_opt: /* empty */
>c++98.y:96.11-97.28: warning: useless rule: declaration_seq_opt:
>declaration_seq
>conflicts: 10 shift/reduce, 2 reduce/reduce
>gcc -g -I. -Wall -g -O0 -o y.tab.o -c y.tab.c
>c++98.y:15: warning: type defaults to 'int' in declaration of 'yydebug'
>c++98.y:15: warning: data definition has no type or storage class
>y.tab.c: In function 'yyFail':
>y.tab.c:664: warning: passing argument 1 of 'yyerror' discards qualifiers from
>pointer target type
>y.tab.c: In function 'yyuserMerge':
>y.tab.c:932: warning: implicit declaration of function 'merging'
>y.tab.c:932: warning: assignment makes pointer from integer without a cast
>y.tab.c: In function 'yyprocessOneStack':
>y.tab.c:1803: warning: implicit declaration of function 'yylex'
>In file included from c++98.y:188:
>lex.yy.c: In function 'yylex':
>lex.yy.c:766: warning: label 'find_rule' defined but not used
>c++98.y: At top level:
>c++98.y:230: error: conflicting types for 'merging'
>y.tab.c:932: error: previous implicit declaration of 'merging' was here
>c++98.y: In function 'main':
>c++98.y:243: warning: implicit declaration of function 'ast2graphviz'
>make: *** [y.tab.o] Error 1
>
>
>
>
all.tar.gz
Description: application/gzip