[antlr-interest] measure line size.
Meena Moktali
mmoktali at bphx.dk
Thu Apr 7 00:21:02 PDT 2005
hi all!
I want to know the length of a line.A sample text is as follows.
"map CURRENCY_SPACE in KSPS4_MSG to TEXT_CODE of STD_MSG_PARM_V of STD_MSG_CLIENT_SRV_I"
I want to divide the line into 2 if it increases more than 72 characters.And the line break should be at
an 'of' or 'to'.
any ideas?
Meena
-----Original Message-----
From: Bharath Sundararaman [mailto:Bharath.Sundararaman at starthis.com]
Sent: 6. april 2005 21:28
To: Martin Probst; FC
Cc: ANTLR Interest
Subject: RE: [antlr-interest] Line number in AST
Hi Martin,
This link might be useful to you:
http://www.milk.com/kodebase/antlr-tutorial/
Bharath.
-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Martin Probst
Sent: Wednesday, April 06, 2005 1:24 PM
To: FC
Cc: ANTLR Interest
Subject: Re: [antlr-interest] Line number in AST
Hi,
> I want to get the line number of java code while
> parsing the source code. How can I generate AST with
> line number in the node?
ASTs are generally generated with line numbers in them, BaseAST has a
method called "getLine()".
> Because I am new to Antlr, I
> expect to see some examples about this.
If you want to know how to get the full location (including column) read
the ANTLR manual.
Regards,
Martin
More information about the antlr-interest
mailing list