[antlr-interest] ANTLR for Style Check?

jason heddings rocket at heddway.com
Thu Mar 1 13:44:07 PST 2007

Responses for this post:

You could use antlr for this, for example, by looking at the token types,
line number and column and changing the styles accordingly - you would only
need a lexer and a while loop with the lexer.getNextToken() statement. In
principle you should be able to use a java grammar file, available from
antl.org to generate your lexer.


ANLTR does sound to me like a good fit, because it has channels that  
would allow you to keep track of white space while parsing the  
regular grammar. I'm curious. For what language you want to write a  
style checker?


I'm trying to develop a style-checking application in Java and as I was
searching around, I ran across ANTLR.  Would this be a suitable use of
ANTLR?  I've been reading the website and feel a bit overwhelemed for
getting started...  Can anyone make a recommendation about where to start
developing this type of application?  Would this involve creating grammars
that represent each style preference, or would it simple walk the resulting
parse tree looking for style?

More information about the antlr-interest mailing list