[antlr-interest] Strange behaviour with '\379' character

Ric Klaren klaren at cs.utwente.nl
Sun Jun 22 11:24:32 PDT 2003


On Sun, Jun 22, 2003 at 06:38:49PM +0200, berserksangr wrote:
> I use ANTLR to generate cpp code for my parser. But when in one of the
> lexer rules I put '\379' character ANTLR malform the produced code.

\379 is not an octal character constant.

> ////OK!
> case static_cast<unsigned char>('\346'):
> {
>      match(static_cast<unsigned char>('\346'));
>      break;
> }
> ///WRONG: g++ compiler fires "incomplete universal-character-name" error.
> case static_cast<unsigned char>('\u101'):
> {
>      match(static_cast<unsigned char>('\u101'));
>      break;
> }

Hmm could you try editing that output to use \x instead of \u ? (try fix
one and see if that fixes that one? If so we got a bug in the C++
codegen for character constants)

> AFAIR the same happens with \380 character.
> 
> Why is it happening this way? How to deal with this problem? I need a
> rule for this characters.

I guess you're making a mistake while converting the hex values to octal ?
So as workaround you could try using octal. I'll check for the hex
constants tomorrow.

Ric
-- 
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893722  ----
-----+++++*****************************************************+++++++++-------
     "Evil will always triumph, because Good is dumb." ---  Spaceballs


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list