[antlr-interest] For getCharPositionInLine(), is there a way to make tab count for 8 chars instead of 1?

Jim Idle jimi at temporal-wave.com
Thu Sep 8 10:23:11 PDT 2011


Please see many past discussions of this in the group archives. It is not
a simple as adding 8 to the count as tabs usually mean "advance to the
next tab position", which is traditionally a multiple of 8 but does not
have to be.

Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Dejas Ninethousand
> Sent: Thursday, September 08, 2011 9:59 AM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] For getCharPositionInLine(), is there a way
> to make tab count for 8 chars instead of 1?
>
> I want to ensure that line and cols reported by my parser line up with
> what the user would see in a program like Textpad.  In Textpad if you
> move the cursor across a tab character the column counter and cursor
> advance by 8 and not 1 even though only one char in the stream has been
> traversed.  Can I configure some setting in ANTRL such that tab chars
> are treated the same way for column reporting?
>
> Thanks.
>
> 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