[antlr-interest] column info for syntactic predicates

Oliver Burn oliver-lists at puppycrawl.com
Sat Sep 14 22:40:14 PDT 2002


> On Saturday, September 14, 2002, at 09:55 PM, Oliver Burn wrote:
> 
> > Hi,
> >
> > I am the author of a tool called Checkstyle (http://checkstyle.sf.net) 
> > which
> > checks that Java code confirms to a coding standard. By default the 
> > Sun coding
> > standard. The tool makes extensive use of ANTLR.
> >
> > I am in the process of refactoring the way Checkstyle works, and want 
> > to track
> > line & column information in syntactic predicates. In my research I 
> > came across
> > the article on tracking column information at
> > http://www.antlr.org/fieldguide/columns/index.html.
> >
> > At the end of the article it says that is it possible to track column 
> > info for
> > syntactic predicates. Does anybody have any more information (or 
> > better still
> > examples) on how to do this.
> 
> Hi Oliver, sounds like a great tool :)

Thanks :-)

> 
> That article is pretty old. ANTLR tracks column number now 
> automatically. I think it's even stored in the token objects now.

The problem I am having is that is does not seem to track column information
for all nodes. I have been trying with ANTLR 2.7.1 and 2.7.2a2.

I have attached a sample input file I have been testing with. Also attached
is a capture of the AST tree using the -showtree option. I am using the
standard Java grammar available from the web site.

As you can see some of the leaf nodes under "VARIABLE_DEF" do not have any
column or line number information. I want to now how to get this information
put into the AST.

> 
> Ter
> --
> Co-founder, http://www.jguru.com
> Creator, ANTLR Parser Generator: http://www.antlr.org

Oliver
 

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: antlr_tree.png
Type: image/png
Size: 4767 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20020915/51989459/antlr_tree.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Demo.java
Type: java/*
Size: 58 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20020915/51989459/Demo.bin


More information about the antlr-interest mailing list