[antlr-interest] Implementing Java sourcecode formatters. Where to start?

Raphael Reitzig r_reitzi at cs.uni-kl.de
Thu Sep 11 10:06:21 PDT 2008


Hi Anatol!

I do not understand your motivation to standardize sources. If you are  
bold enough to allow different IDEs (company or open source?), you  
should be able to cope with heterogenous source in your repository.  
Everbody can hit his key combination to format sources once he opens  
them. No harm done.

If you insist, use an IDE independent source formatter instead of  
going through the process of learning how to use ANTLR.

OT: What do different IDEs different in code formatting? At least for  
Java, there are styleguides by SUN that should be somewhat mandatory  
in project contexts, I think.

Regards

Raphael

"Anatol Pomozov" <anatol.pomozov at gmail.com> wrote (Sun Sep  7 00:39:09 2008):

> Hi,
>
> I work in a big Java team that has heterogeneous software environment. I
> prefer to use IDEA for development, some other people Eclipse or Emacs. In
> our team we try to keep unified style for the source code. But unfortunately
> IDE's that we use have different options for code formatting and quite
> difficult to find such style that satisfies all IDE's. So a lot of code
> reformatting work I do by hands. And I feel that I do dumb work when I
> reorder imports/add blank lines between class member definitions etc... I
> want that some tool do it for me.
>
> That is why I wan to implement code formatting tool for Java/Javascript.
> Actually I tried to find such opensource tool and only I found is Jalopy
> which is not developed anymore (last release in 2005).
>
> I want to use ANTLR. Actually I am ANTLR newbie (although I know general
> theoretical part of lexers/parsers) and not sure that it is the best tool
> for implementing code transformers.
>
> So what I ask here is advise. Is it ok to use ANTLR for code formatters?
> Where to start? Do you have any good example for such kind of tasks? Any
> advice would be helpful.
>
> Thanks.
>
> --
> anatol
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: PGP Digital Signature
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20080911/b9ddb8ff/attachment.bin 


More information about the antlr-interest mailing list