[antlr-interest] ST feature proposal

Terence Parr parrt at cs.usfca.edu
Fri Jul 10 11:42:26 PDT 2009


Hi Graham, yep, i wonder if we need both "ignore newline" and "ignore  
newline and indentation".  Actually, Ignore \n without ignoring  
whitespace doesn't make any sense because without a \n there is no  
indentation ;)

I think <\\> should work just fine and would be very helpful.

Ter

On Jul 9, 2009, at 7:19 PM, Graham Wideman wrote:

> Hi Ter,
>
> Idea looks attractive to me. Comments:
>
>> Perhaps we need another special symbol that means
>> allow me to do a newline and it didn't the next line,
>> but don't put it into the output.
>
> "it didn't"  probably = "indent"?
>
> So basically, the double-backslash expression means ignore  
> subsequent whitespace that matches some pattern, probably:
>
>    [space or tab]* newline [space or tab]*
>
> ... or did you intend more like:
>
>    [space or tab or newline]*
>
> ...following which could be another expression, or non-whitespace  
> string.
>
> Issue: Might there be occasions where you actually want to retain a  
> space before what follows, and if so what do you do about that? I'm  
> not *sure* this is a problem, just noting it.
>
> Perhaps could have optional space suffixed to the double-backslash  
> expression?
>
> Ie:
> <\\>  vs
> <\\ >
>
> My 2 cents
>
> -- Graham
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list