[antlr-interest] how to get rid of newlines in the ast

Dave Cramer davec at postgresintl.com
Fri Mar 23 08:15:42 PDT 2007


Hi,

I copied your code verbatim from

http://www.antlr.org/wiki/display/ANTLR3/Simple+tree-based+interpeter

Add a blank line into the middle of the input and it throws a NPE

Dave
On 23-Mar-07, at 11:00 AM, Terence Parr wrote:

> Hi. I use this all the time.  A real and small grammar usually  
> highlights what's wrong.
> Ter
> On Mar 23, 2007, at 6:00 AM, Dave Cramer wrote:
>
>> I've tried following the examples where they suggest	
>>
>> NEWLINE ->
>>
>> however if you have a completely empty line you end up with a null  
>> pointer exception
>>
>> So the solution seems to be to put NEWLINES into the ast and then  
>> take them out there ?
>>
>> I want my grammar to not use any special end of line terminator  
>> other than NEWLINE.
>>
>> Dave
>
>



More information about the antlr-interest mailing list