[antlr-interest] Strange character Recognition. (C++ Only)

Ric Klaren klaren at cs.utwente.nl
Fri May 31 01:57:54 PDT 2002


Hi,

On Wed, May 29, 2002 at 08:26:19AM -0600, Trey Spiva wrote:
> Additional Information: The '*' are really character 0x95.  My EMAIL client

> it is broken when I use Antlr to produce a C++ parser.

What is exactly broken ? I think I lost your previous mails on the subject..
Is the rule for the multi line comment broken, check the charactersets in
used in the rule.. so for instance if I run the java.g through my current
cvs version, then I see things like:

if ((LA(1) == static_cast<unsigned char>('\r')) &&
	(LA(2) == static_cast<unsigned char>('\n')) &&
	((LA(3) >= static_cast<unsigned char>('\3') &&
	LA(3) <= static_cast<unsigned char>('\377'))) &&
	((LA(4) >= static_cast<unsigned char>('\3')
	&& LA(4) <= static_cast<unsigned char>('\377')))) {
	match(static_cast<unsigned char>('\r'));

etc.

As you can see the 'big' charVocabulary is in there. If this is not the
case for you then upgrade your antlr distro (didn't catch which one you are
using). Is it in there then maybe something goes wrong in the character
reading traject (the LA() method and below) it could be that some
characters are mangled in some cases by buggy standard functions. Make a
testfile with just a comment and the offending character and trace through
it.

> > Notice the dots.  They are not part of the standard ascii character set.
> > When I try to parse this file using the java.g that is shipped in the CPP
> > examples I get the error message :"unexpected char *".  I have the
> > charVocabulary set to charVocabulary = '\3'..'\377'.

Which compiler/platform are you on?

Cheers,

Ric
--
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- klaren at cs.utwente.nl ----- +31 53 4893722  ----
-----+++++*****************************************************+++++++++-------
 Time what is time - I wish I knew how to tell You why - It hurts to know -
          Aren't we machines - Time what is time - Unlock the door
               - And see the truth - Then time is time again
                From: 'Time what is Time' by Blind Guardian


 

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



More information about the antlr-interest mailing list