Searching a translatable string likely isn't a good idea...
An own skeleton file (as part of the source tarball) looks like a big
cannon, therefore we may go with tweaking the parser sources via
makefile (the good part: people "normally" get the parser sources via
this makefile and if they don't they only miss a descriptive message).

Simon

Am 27.04.2016 um 23:53 schrieb Hans Åberg:
> 
>> On 27 Apr 2016, at 23:15, Simon Sobisch <simonsobi...@gnu.org> wrote:
>>
>> this could work if we pass the current token, using
>>
>>      %parse-param (char * yytext)
>>
>> tehn use a wrapper for the current yyerror function.
>> If we get this specific error we we can do the checks on the passed yytext.
>>
>> The problem here:
>> How do we know that the error message "Unexpected %s" occured? A string
>> compare against all the translated texts (all 5 versions) looks stupid
>> and brake if the message is ever changed.
> 
> The problem with tweaking the parser sources is that when it is recompiled it 
> is lost, and a similar thing may happen if you make your own skeleton file 
> and Bison is updated. Properly it would be a feature request, I think, but 
> development seems not very active right now.
> 
> So it looks best with a search of the yyerror() argument text. If your 
> keywords are not  one of the error message words (“unexpected" etc.), it may 
> suffice to search for them, adding a line when they appear.
> 
> The %parse-param would make the parser pure, by adding the lookup table 
> reference there.
> 
> 
> 
> 

_______________________________________________
help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to