[antlr-interest] tab handling in ANTLR

Matthew Ford Matthew.Ford at forward.com.au
Sat Dec 22 19:44:32 PST 2001


I was slightly worried about loosing the connection between the column count
and the actual characters for error outputs to the user. (personally I set
tabs to 4).
Actually in my application I expand tabs to 4 spaces before passing to Antlr
to ensure that some indenting is maintained and the column count indicates
the error position.
I assume the tab() method is for error messages (to return the 'correct'
column count)
Actually I think antlr needs more than just this.  It need something like a
line buffer that can be retrieved so you can show the user the offending
input line and the column count.  I my application I have a pre-filter that
keeps track of the input lines and saves them for possible use in error
routines.
This email is getting waffly but what I think I am saying is that just
adding tab() does not solve the problem as far as I am concerned and what
ever default you choose will be 'wrong'  so if you put it in I would vote
for a default of 1 for tab() so existing code works as before and let the
user over-ride as they like.
matthew
----- Original Message -----
From: "Terence Parr" <parrt at jguru.com>
To: <antlr-interest at yahoogroups.com>
Sent: Sunday, December 23, 2001 2:01 PM
Subject: Re: [antlr-interest] tab handling in ANTLR


>
> On Saturday, December 22, 2001, at 06:45  PM, Matthew Ford wrote:
>
> > At the very least this code should be  in the comments/docs so people
> > know
> > what to do.
>
> Ok, thanks.  Can anybody think of a reason why I should handle tabs
> "normally" by default?  You can set the tabsize or override tab()
> completely.  Make sense?
>
> Ter
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


 

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



More information about the antlr-interest mailing list