[antlr-interest] Proper handling of newlines with gUnit???? (was: Null Pointer Exception from valid gUnit test)...

Sylvain, Gregory [USA] sylvain_gregory at bah.com
Fri Jul 10 13:28:48 PDT 2009


 

Seeing that no one had a reply to my earlier query, I assume something got lost in the message or I am just being stupid.

I like to assume the former :-)

I have been able to unit test the lexer, but the parser is giving me problems.  Like I said, I am able to run the exact same text strings through the interpreter and everything works fine.  But when I include the same strings in the .gunit file itself (with either dbl. quotes or dbl. angle brackets, '"' or '<<' & '>>') or include the test in a separate input file, the unit tests fails!

I'm suspecting that it may be the way gunit is handling multiple newlines?  The grammar defines a EOL as follows:

EOL	: ( CRCRLF | CRLF | LF ) ;
fragment CRCRLF : '\r\r\n' ;
fragment CRLF : '\r\n' ;
fragment LF : '\n' ;


With the CRCRLF form of newline being the most prevelant.

Any ideas about how to get these unit tests to work via gunit?  

Thanks in advance, any clues would be appreciated.
Greg

-----Original Message-----
Message: 10
Date: Thu, 9 Jul 2009 07:47:19 -0400
From: "Sylvain, Gregory [USA]" <sylvain_gregory at bah.com>
Subject: [antlr-interest] Null Pointer Exception from valid gUnit test
	(ANTLR 3.1.3 and gnuit-1.0.4)
To: "antlr-interest at antlr.org" <antlr-interest at antlr.org>
Message-ID: <825E1B6D-3BEB-4399-9B75-43FB79BF2878 at mimectl>
Content-Type: text/plain; charset="iso-8859-1"

Hi,

I've been trying to complete some unit testing of a grammar, and I keep getting Null Pointer Exceptions from valid gUnit tests.  (The unit test strings work fine from the Interpreter in Eclipse (ANTLR IDE) and ANTLRWorks).  Is this is a known bug, or am I just doing something obviously wrong.

Thanks for any clues here,
Greg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090709/bc267843/attachment-0001.html 

------------------------------


More information about the antlr-interest mailing list