[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Generated file has non-UTF-8 characters
From: |
Akim Demaille |
Subject: |
Re: Generated file has non-UTF-8 characters |
Date: |
Mon, 18 Nov 2013 09:06:31 +0100 |
Le 16 nov. 2013 à 20:33, Arthur Schwarz <address@hidden> a écrit :
> Bison 2.7.1
>
> Hi Akim;
Hi Arthur,
Please, keep the CC so that answer remain public.
> Thanks for the reply. The error occurs in yyerror() below. The code for
> yyerror() is from bison's skeleton.
No, it is not. It typically comes from your *.y file.
> I'm using cygwin and I tried to find the skeleton using find * -iname
> 'bison*' with no luck. If you tell me where the skeleton is I'd like to see
> if the issue is in my version of it.
>
> I retyped the offending line and the error disappeared. Now I'm trudging
> through the remaining errors to rediscover the mysteries of the Orient and
> get a working parser.
>
> Thanks
> Art
>
> ---- code ----
>
> yyerror(char *s) { /* Called by yyparse on error */
> printf (�%s\n�, s);
Obviously you'r problem is here: your own definition of the user-defined
function yyerror uses extended quotes, instead of plain, ASCII, good ol' ".
You must fix your *.y file (and btw, errors should rather be sent to
stderr in typical cases, so
void yyerror (const char *s)
{
fprintf (stderr, "%s\n", s);
}
is more traditional.
> }; // yyerror(char *s)
>
> -----Original Message-----
> From: Akim Demaille [mailto:address@hidden
> Sent: Saturday, November 16, 2013 8:19 AM
> To: Arthur Schwarz
> Cc: address@hidden
> Subject: Re: Generated file has non-UTF-8 characters
>
>
> Le 16 nov. 2013 à 16:52, Arthur Schwarz <address@hidden> a écrit :
>
>> IDE: Netbeans 7.4
>>
>> COMPILER: gcc 4.8.1
>>
>> I just started using bison and received the following message when trying to
>> edit the bison generated cpp file. The resultant compilation shows many
>> errors because of non-UTF-8 characters. Is there any way to direct bison to
>> use only UTF-8 files in its generated output?
>
> Hi,
>
> Bison uses only ASCII itself, if there is UTF-8 in the generated
> output, it comes from the input (which may include paths names
> on your account, so if you are compiling in a directory with
> non-ascii characters, you might have a problem).
>
> In any case, looking at the troublesome line will be more helpful
> than wild guesses.
>