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

berserksangr berserksangr at poczta.onet.pl
Sun Jun 22 09:38:49 PDT 2003


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.

For example when I use this rule:

('?'(WS)*('A'..'Z'|'\262'|'\321'|'\211'|'\346'|'\379'))

ANTLR put something like this into produced Lexer:

////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;
}

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.

-- 
Best regards,
 berserksangr                          mailto:berserksangr at poczta.onet.pl


 

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




More information about the antlr-interest mailing list