Tools to "prettify" source code

Michael Stumpfl <michael.stumpfl@jkh.uni-linz.ac.at>
28 Mar 2001 08:45:46 -0500

          From comp.compilers

Related articles
Tools to "prettify" source code michael.stumpfl@jkh.uni-linz.ac.at (Michael Stumpfl) (2001-03-28)
Re: Tools to "prettify" source code idbaxter@semdesigns.com (Ira D. Baxter) (2001-03-31)
RE: Tools to "prettify" source code qjackson@home.com (Quinn Tyler Jackson) (2001-03-31)
Re: Tools to "prettify" source code viola@pp.htv.fi (Pekka Enberg) (2001-03-31)
Re: Tools to "prettify" source code eliotm@pacbell.net (Eliot Miranda) (2001-04-04)
Re: Tools to "prettify" source code perkens@sdm.de (Burkhard Perkens-Golomb) (2001-04-04)
Re: Tools to "prettify" source code ericbr@oz.net (Eric Brown) (2001-04-04)
[4 later articles]
| List of all articles for this month |
From: Michael Stumpfl <michael.stumpfl@jkh.uni-linz.ac.at>
Newsgroups: comp.compilers
Date: 28 Mar 2001 08:45:46 -0500
Organization: Compilers Central
Keywords: tools, question, comment
Posted-Date: 28 Mar 2001 08:45:46 EST

Hi,


I´ve just recently stumbled across this ng, so I'm not sure if my
problem has already been discussed at full length: Does anybody of you
know of a tool to "prettify" source code automatically (C++/JAVA)? The
only difference to "real" compiler would be that no executable is
output in the end, but a new source file conforming to a previously
defined style template, e.g.:


You have some source code like this:


#include<stdio.h>
#define dEbUG
#define constANT 1
int VARIABLE=constANT;void main (void){printf("\r\nUseless example program 1.0\r\n");
#ifdef dEbUG
    printf ("\r\nvariable = %d\r\n",VARIABLE);
#endif
}




And after running "restyle test.cpp style-template.dat" you get something like this:


#include<stdio.h>




//--------------------------- CONSTANTS ---------------------------
#define DEBUG
#define CONSTANT 1




//----------------------- GLOBAL VARIABLES ------------------------
int
    iVariable = CONSTANT;




//------------------------------ MAIN -----------------------------
void main (void)
{
    printf("\r\nUseless example program 1.0\r\n");


#ifdef DEBUG
    printf("\r\nvariable = %d\r\n",iVariable);
#endif


}


I´ve already searched the web for many hours, but to no avail.


Many thanks in advance


Michael
[It's hard to believe there's no pretty-printer for C++. There are
certainly many of them for C, although I'd be leery of one that went
around renaming my symbols. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.