Tools to "prettify" source code

Michael Stumpfl <>
28 Mar 2001 08:45:46 -0500

          From comp.compilers

Related articles
Tools to "prettify" source code (Michael Stumpfl) (2001-03-28)
Re: Tools to "prettify" source code (Ira D. Baxter) (2001-03-31)
RE: Tools to "prettify" source code (Quinn Tyler Jackson) (2001-03-31)
Re: Tools to "prettify" source code (Pekka Enberg) (2001-03-31)
Re: Tools to "prettify" source code (Eliot Miranda) (2001-04-04)
Re: Tools to "prettify" source code (Burkhard Perkens-Golomb) (2001-04-04)
Re: Tools to "prettify" source code (Eric Brown) (2001-04-04)
[4 later articles]
| List of all articles for this month |

From: Michael Stumpfl <>
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


Ive 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:

#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);

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


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

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

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

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


Ive already searched the web for many hours, but to no avail.

Many thanks in advance

[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.