473,411 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

C/C++ code beautifier

Hi all!

Is there a linux tool that uses as input my ugly C/C++ code and
outputs a pretty and nice formated source code?

Regards,

Diego
Jul 22 '05 #1
19 3419
Diego Andres Alvarez Marin wrote:
Is there a linux tool that uses as input my ugly C/C++ code and
outputs a pretty and nice formated source code?


Have you tried www.google.com?
Jul 22 '05 #2
On Tue, 16 Nov 2004 15:17:45 -0800, Diego Andres Alvarez Marin wrote:
Hi all!

Is there a linux tool that uses as input my ugly C/C++ code and
outputs a pretty and nice formated source code?

Regards,

Diego


Assuming you mean C and/or C++, yes, there are many. This is not on-topic
here though, you should ask in comp.unix.programmer or a linux group. You
could alternatively learn how to use a search engine and find all the
information you seek in a few seconds.

Rob Gamble
Jul 22 '05 #3
Diego Andres Alvarez Marin wrote:


Is there a linux tool that uses as input my ugly C/C++ code and
outputs a pretty and nice formated source code?

Artistic Style

http://astyle.sourceforge.net/

Jul 22 '05 #4
On Tue, 16 Nov 2004 15:21:38 -0800, E. Robert Tisdale wrote:
Diego Andres Alvarez Marin wrote:


Is there a linux tool that uses as input my ugly C/C++ code and
outputs a pretty and nice formated source code?

Artistic Style

http://astyle.sourceforge.net/


To the OP: If you have any questions or comments about this program,
please feel free to email Tisdale directly as opposed to asking here.

Rob Gamble
Jul 22 '05 #5
Robert Gamble wrote:
Assuming you mean C and/or C++, yes, there are many.


Out of curiosity, when would C/C++ ever mean anything *other* than "C and/or C++"?
Jul 22 '05 #6
In article <50**************************@posting.google.com >,
Steve Kobes <st*********@hotmail.com> wrote:
Robert Gamble wrote:
Assuming you mean C and/or C++, yes, there are many.


Out of curiosity, when would C/C++ ever mean anything *other* than "C
and/or C++"?


http://groups.google.com/gr*********...it.cornell.edu

Unfortunately the link seems to be dead.
dave

--
Dave Vandervies dj******@csclub.uwaterloo.ca

Silly, yes. But have we shown that it is unhelpful?
--Daniel Fox in comp.lang.c
Jul 22 '05 #7
Quoth Diego Andres Alvarez Marin on or about 2004-11-16:
Is there a linux tool that uses as input my ugly C/C++ code and
outputs a pretty and nice formated source code?


GNU Indent
http://directory.fsf.org/GNU/indent.html
http://gnuwin32.sourceforge.net/packages/indent.htm

HTH
-trent
Jul 22 '05 #8
Victor Bazarov <v.********@comAcast.net> wrote in message news:<L6*****************@newsread1.dllstx09.us.to .verio.net>...
Diego Andres Alvarez Marin wrote:
Is there a linux tool that uses as input my ugly C/C++ code and
outputs a pretty and nice formated source code?


Have you tried www.google.com?


Believe me that I spend 15 minutes before asking here and I did not
find anything... maybe I did not put the right words...
Jul 22 '05 #9
di****************@lycos.co.uk (Diego Andres Alvarez Marin) writes:
Victor Bazarov <v.********@comAcast.net> wrote in message news:<L6*****************@newsread1.dllstx09.us.to .verio.net>...
Diego Andres Alvarez Marin wrote:
> Is there a linux tool that uses as input my ugly C/C++ code and
> outputs a pretty and nice formated source code?


Have you tried www.google.com?


Believe me that I spend 15 minutes before asking here and I did not
find anything... maybe I did not put the right words...


"c beautifier" hits lots of useful programs and links.
--
"I hope, some day, to learn to read.
It seems to be even harder than writing."
--Richard Heathfield
Jul 22 '05 #10
st*********@hotmail.com (Steve Kobes) wrote:
Robert Gamble wrote:
Assuming you mean C and/or C++, yes, there are many.


Out of curiosity, when would C/C++ ever mean anything *other* than "C and/or C++"?


All too often, when someone uses the term "C/C++", it appears that they
mean "C and C++-with-objects-ignored, which is exactly the same thing,
isn't it?". Of course, it isn't the same thing at all, and such people
tend to run into problems trying to compile C code with a C++ compiler,
or vice versa.

Richard
Jul 22 '05 #11
On Wed, 17 Nov 2004 00:07:23 -0800,
Ben Pfaff <bl*@cs.stanford.edu> wrote:

di****************@lycos.co.uk (Diego Andres Alvarez Marin) writes:
Victor Bazarov <v.********@comAcast.net> wrote in message news:<L6*****************@newsread1.dllstx09.us.to .verio.net>...
Diego Andres Alvarez Marin wrote:
> Is there a linux tool that uses as input my ugly C/C++ code and
> outputs a pretty and nice formated source code?

Have you tried www.google.com?


Believe me that I spend 15 minutes before asking here and I did not
find anything... maybe I did not put the right words...


"c beautifier" hits lots of useful programs and links.


Not to mention that normally linux comes with a butifier, as did most unix
systems for decades.

Villy
Jul 22 '05 #12
Diego Andres Alvarez Marin wrote:
Victor Bazarov wrote:
Diego Andres Alvarez Marin wrote:
Is there a linux tool that uses as input my ugly C/C++ code and
outputs a pretty and nice formated source code?
Have you tried www.google.com?


Believe me that I spend 15 minutes before asking here
and I did not find anything...


You should have told us that in your original post.
Maybe I did not put the right words...


I used Google

http://www.google.com/

to search for

+"reformat C++"

and I found lots of stuff including:

http://www.vijayawadasite.com/home/c...al-issues.html

[30.2] Are there any pretty-printers that reformat C++ source code?

[snip]

In alphabetical order:

* Artistic Style is a reindenter and reformatter of C++, C and Java
source code. It is available from http://gene.md.huji.ac.il/~tald/astyle/
* C++2LaTeX is a LaTeX pretty printer. It is available from
http://mirriwinni.cse.rmit.edu.au/ft...TeX-4.0.tar.gz
* C-Clearly by V Communications, Inc. is a Windows program that
comes with standard formatting templates and also allows you to
customize your own. http://www.mixsoftware.com/product/ccl.htm
* GNU indent program may help. It's available at
http://www.arceneaux.com/indent.html. You can also find an "official"
GNU mirror site by looking at http://www.gnu.org/order/ftp.html or
perhaps the original GNU site, ftp://prep.ai.mit.edu/pub/gnu/ (e.g., if
the current version is 1.9.1 you could use
ftp://prep.ai.mit.edu/pub/gnu/indent-1.9.1.tar.gz).
* tgrind is a Unix based pretty printer. It usually comes with the
public distribution of TeX and LaTeX in the directory
"...tex82/contrib/van/tgrind". A more up-to-date version of tgrind by
Jerry Leichter can be found on: ftp://venus.ycc.yale.edu/pub in
[.TGRIND]. [Note: If anyone has an updated URL for tgrind, please let me
know (cl***@parashift.com).]

Finally, you might consider lgrind which is another C++ to LaTeX
translator (check for the closest mirror site of the ctan archive). The
following is a grind definition for C++ (but this one doesn't recognize
some new keywords such as bool or wchar_t, and it doesn't recognize a
file ending with .cpp as C++):

C++|c++|CC:\
:pb=\p\d?\(:cf:np=\)\d?;:bb={:be=}:\
:cb=/*:ce=*/:ab=//:ae=$:sb=":se=\e":lb=':\
:zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|% :\
:le=\e':tl:id=_~\::\
:kw=asm auto break case cdecl char continue default do double else\
enum extern far float for fortran goto huge if int interrupt long\
near pascal register return short signed sizeof static struct\
switch typedef union unsigned while void\
#define #else #endif #if #ifdef #ifndef #include #undef # define\
endif ifdef ifndef include undef defined #pragma\
class const delete friend inline new operator overload private\
protected public template this virtual:
Jul 22 '05 #13
On 16 Nov 2004 21:26:22 -0800, in comp.lang.c , st*********@hotmail.com
(Steve Kobes) wrote:
Robert Gamble wrote:
Assuming you mean C and/or C++, yes, there are many.


Out of curiosity, when would C/C++ ever mean anything *other* than "C and/or C++"?


Quite frequently, people that use "C/C++" have the idea that the two
languages are so similar that they're interchangable, or that C is a subset
of C++, or that C++ is a superset of C. None of these is true, hence the
mere sight of C/C++ tends to send shivers up the regular's spines.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 22 '05 #14
Steve Kobes wrote:
Robert Gamble wrote:
Assuming you mean C and/or C++, yes, there are many.

Out of curiosity, when would C/C++ ever mean anything *other* than "C and/or C++"?


C++ was designed by the same people at Bell Labs.
C++ was designed to replace C and not compete with it.
C++ *subsumes* C.
Most popular implementations compile both C or C++.
Jul 22 '05 #15
Steve Kobes wrote:
Robert Gamble wrote:
Assuming you mean C and/or C++, yes, there are many.

Out of curiosity, when would C/C++ ever mean anything *other* than "C and/or C++"?


Roman numerals mixed with C operators? 100/100++ = 100/101 ~= 0.99
Jul 22 '05 #16
In message <cn**********@nntp1.jpl.nasa.gov>, E. Robert Tisdale
<E.**************@jpl.nasa.gov> trolled

C++ was designed by the same people at Bell Labs.


bool same(std::string a, std::string b);

assert(same("Stroustrup", "Ritchie"));

Yeah, right.

--
Richard Herring
Jul 22 '05 #17
I always though that a C/C++ beautifier was ADA....

Runs off to find asbestos suit and a ticket off the planet :-)

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Jul 22 '05 #18
"E. Robert Tisdale" <E.**************@jpl.nasa.gov> wrote in message news:<cn**********@nntp1.jpl.nasa.gov>...
Diego Andres Alvarez Marin wrote:
Victor Bazarov wrote:
Diego Andres Alvarez Marin wrote:

Is there a linux tool that uses as input my ugly C/C++ code and
outputs a pretty and nice formated source code?

Have you tried www.google.com?


Believe me that I spend 15 minutes before asking here
and I did not find anything...


You should have told us that in your original post.
Maybe I did not put the right words...


I used Google

http://www.google.com/

to search for

+"reformat C++"

and I found lots of stuff including:

http://www.vijayawadasite.com/home/c...al-issues.html

[30.2] Are there any pretty-printers that reformat C++ source code?

[snip]

In alphabetical order:

* Artistic Style is a reindenter and reformatter of C++, C and Java
source code. It is available from http://gene.md.huji.ac.il/~tald/astyle/
* C++2LaTeX is a LaTeX pretty printer. It is available from
http://mirriwinni.cse.rmit.edu.au/ft...TeX-4.0.tar.gz
* C-Clearly by V Communications, Inc. is a Windows program that
comes with standard formatting templates and also allows you to
customize your own. http://www.mixsoftware.com/product/ccl.htm
* GNU indent program may help. It's available at
http://www.arceneaux.com/indent.html. You can also find an "official"
GNU mirror site by looking at http://www.gnu.org/order/ftp.html or
perhaps the original GNU site, ftp://prep.ai.mit.edu/pub/gnu/ (e.g., if
the current version is 1.9.1 you could use
ftp://prep.ai.mit.edu/pub/gnu/indent-1.9.1.tar.gz).
* tgrind is a Unix based pretty printer. It usually comes with the
public distribution of TeX and LaTeX in the directory
"...tex82/contrib/van/tgrind". A more up-to-date version of tgrind by
Jerry Leichter can be found on: ftp://venus.ycc.yale.edu/pub in
[.TGRIND]. [Note: If anyone has an updated URL for tgrind, please let me
know (cl***@parashift.com).]

Finally, you might consider lgrind which is another C++ to LaTeX
translator (check for the closest mirror site of the ctan archive). The
following is a grind definition for C++ (but this one doesn't recognize
some new keywords such as bool or wchar_t, and it doesn't recognize a
file ending with .cpp as C++):

C++|c++|CC:\
:pb=\p\d?\(:cf:np=\)\d?;:bb={:be=}:\
:cb=/*:ce=*/:ab=//:ae=$:sb=":se=\e":lb=':\
:zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|% :\
:le=\e':tl:id=_~\::\
:kw=asm auto break case cdecl char continue default do double else\
enum extern far float for fortran goto huge if int interrupt long\
near pascal register return short signed sizeof static struct\
switch typedef union unsigned while void\
#define #else #endif #if #ifdef #ifndef #include #undef # define\
endif ifdef ifndef include undef defined #pragma\
class const delete friend inline new operator overload private\
protected public template this virtual:


Check out a Windows program called Crystal FLOW for C/C++ from
http://www.sgvsarc.com/

In addition to an excellent code beautifier, it creates flowcharts
from C/C++ code. Has a complete code browser too.
Jul 22 '05 #19
Chris Hills <ch***@phaedsys.org> wrote in message news:<c2**************@phaedsys.demon.co.uk>...
I always though that a C/C++ beautifier was ADA....

Runs off to find asbestos suit and a ticket off the planet :-)

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

I found an excellent Windows program called Crystal FLOW for C/C++ from
http://www.sgvsarc.com/

In addition to a nice code beautifier, it creates the best flowcharts
from code I have seen. It has a complete code browser too.
Jul 22 '05 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Robert Freund | last post by:
I've been looking for a good and free code beautifier that runs on linux. About the only ones I found where Trita (www.trita.com), which costs money and only runs on windows. The other one was...
1
by: Sparhawk | last post by:
Hi, I want to integrate a code beautifier for C++ in the development process of my company. There are many beautifiers around which would meet our formatting requirements (SourceFormatX,...
4
by: groleo | last post by:
Hi. Do you know any good code beautifier for c++? I tried indent but it screws my code, and astyle seems to go by its own rules :)
22
by: Diego Andres Alvarez Marin | last post by:
Hi all! Is there a linux tool that uses as input my ugly C/C++ code and outputs a pretty and nice formated source code? Regards, Diego
4
by: Shug | last post by:
Hi, We need a C++ beautifier, and due to the specific requirements of some of our developers, it has to be very configurable. After trying some free ones, we now realise that we might need to...
18
by: Franz Steinhaeusler | last post by:
Hello, I did not find any reasonable pyhton source code beautifier program (preferable gui). Some would ask why? Program it immediatly good. (BTW: Would be a nice project, if I would have more...
2
by: Ole Mercano | last post by:
When I insert a new Eventhandler or function VS 2005 does this automatically with an indent which I don't like. Furthermore I would change the curly bracket handling. Is there soemthing like a...
1
by: Chris Mullins [MVP - C#] | last post by:
We've got a lot of code we're about to migrate from .Net 1.1 to .Net 3.5. This code has, shall we say, a somewhat organic coding style. I would like to run all the code thorugh a C# Beautifier...
2
by: sevak316 | last post by:
Searched the forum and didn't find any topics on this. Does anyone know where I can find a user friendly C beautifier. We are using Indent right now, but it doesnt have a friendly interface. If...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.