[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gcc's C parser bitten by error recovery changes in bison 1.50
From: |
Akim Demaille |
Subject: |
Re: gcc's C parser bitten by error recovery changes in bison 1.50 |
Date: |
16 Oct 2002 13:21:24 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter) |
>>>>> "Zack" == Zack Weinberg <address@hidden> writes:
>> Wow... I do hope that you don't care :( But if you really do want
>> to do that, you want to apply a patch similar to the reverse of:
Zack> Um, I think you misunderstand. Assuming that we care, I don't
Zack> want to change bison.simple. I want to adjust the rules in
Zack> GCC's .y file so that it behaves the same way under both error
Zack> recovery schemes.
Ah, yes, I misunderstood, sorry.
Well, I don't know. I suppose the best means to ``fix'' this is to
introduce another error recovery rule. I managed to get the
following:
gcc/build/gcc % ./cc1 /tmp/foo.c nostromo 13:18
a_translate
/tmp/foo.c: Dans la fonction «a_translate»:
/tmp/foo.c:7: error: erreur d'analyse syntaxique before '{' token
/tmp/foo.c:11: error: `p_addr' undeclared (first use in this function)
/tmp/foo.c:11: error: (Each undeclared identifier is reported only once
/tmp/foo.c:11: error: for each function it appears in.)
Temps d'exécution (secondes)
parser : 0.01 (100%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
TOTAL : 0.01 0.01 0.25
gcc/build/gcc % LC_ALL=C ./cc1 /tmp/foo.c nostromo Err 1
a_translate
/tmp/foo.c: In function `a_translate':
/tmp/foo.c:7: error: parse error before '{' token
/tmp/foo.c:11: error: `p_addr' undeclared (first use in this function)
/tmp/foo.c:11: error: (Each undeclared identifier is reported only once
/tmp/foo.c:11: error: for each function it appears in.)
Execution times (seconds)
parser : 0.01 (50%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
TOTAL : 0.02 0.00 0.25
with the following code. Obviously, the code of my action is quire
random: I tried to use $$ = error_mark_node, but the compiler rejects
it later. So I copied the real code from do-while:
f.patch
Description: Text Data