C/C++ code beautifier

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Diego Andres Alvarez Marin

    #1

    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
  • Victor Bazarov

    #2
    Re: C/C++ code beautifier

    Diego Andres Alvarez Marin wrote:[color=blue]
    > Is there a linux tool that uses as input my ugly C/C++ code and
    > outputs a pretty and nice formated source code?[/color]

    Have you tried www.google.com?

    Comment

    • Robert Gamble

      #3
      Re: C/C++ code beautifier

      On Tue, 16 Nov 2004 15:17:45 -0800, Diego Andres Alvarez Marin wrote:
      [color=blue]
      > 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[/color]

      Assuming you mean C and/or C++, yes, there are many. This is not on-topic
      here though, you should ask in comp.unix.progr ammer 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

      Comment

      • E. Robert Tisdale

        #4
        Re: C/C++ code beautifier

        Diego Andres Alvarez Marin wrote:[color=blue]
        >
        >
        > Is there a linux tool that uses as input my ugly C/C++ code and
        > outputs a pretty and nice formated source code?[/color]


        Artistic Style



        Comment

        • Robert Gamble

          #5
          Re: C/C++ code beautifier

          On Tue, 16 Nov 2004 15:21:38 -0800, E. Robert Tisdale wrote:
          [color=blue]
          > Diego Andres Alvarez Marin wrote:[color=green]
          >>
          >>
          >> Is there a linux tool that uses as input my ugly C/C++ code and
          >> outputs a pretty and nice formated source code?[/color]
          >
          >
          > Artistic Style
          >
          > http://astyle.sourceforge.net/[/color]

          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

          Comment

          • Steve Kobes

            #6
            Re: C/C++ code beautifier

            Robert Gamble wrote:[color=blue]
            > Assuming you mean C and/or C++, yes, there are many.[/color]

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

            Comment

            • Dave Vandervies

              #7
              Re: C/C++ code beautifier

              In article <50d1fce8.04111 62126.19476795@ posting.google. com>,
              Steve Kobes <stevenkobes@ho tmail.com> wrote:[color=blue]
              >Robert Gamble wrote:[color=green]
              >> Assuming you mean C and/or C++, yes, there are many.[/color]
              >
              >Out of curiosity, when would C/C++ ever mean anything *other* than "C
              >and/or C++"?[/color]



              Unfortunately the link seems to be dead.


              dave

              --
              Dave Vandervies dj3vande@csclub .uwaterloo.ca

              Silly, yes. But have we shown that it is unhelpful?
              --Daniel Fox in comp.lang.c

              Comment

              • Trent Buck

                #8
                Re: C/C++ code beautifier

                Quoth Diego Andres Alvarez Marin on or about 2004-11-16:[color=blue]
                > Is there a linux tool that uses as input my ugly C/C++ code and
                > outputs a pretty and nice formated source code?[/color]

                GNU Indent



                HTH
                -trent

                Comment

                • Diego Andres Alvarez Marin

                  #9
                  Re: C/C++ code beautifier

                  Victor Bazarov <v.Abazarov@com Acast.net> wrote in message news:<L6wmd.110 28$Ae.3905@news read1.dllstx09. us.to.verio.net >...[color=blue]
                  > Diego Andres Alvarez Marin wrote:[color=green]
                  > > Is there a linux tool that uses as input my ugly C/C++ code and
                  > > outputs a pretty and nice formated source code?[/color]
                  >
                  > Have you tried www.google.com?[/color]

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

                  Comment

                  • Ben Pfaff

                    #10
                    Re: C/C++ code beautifier

                    diegoandresalva rez@lycos.co.uk (Diego Andres Alvarez Marin) writes:
                    [color=blue]
                    > Victor Bazarov <v.Abazarov@com Acast.net> wrote in message news:<L6wmd.110 28$Ae.3905@news read1.dllstx09. us.to.verio.net >...[color=green]
                    >> Diego Andres Alvarez Marin wrote:[color=darkred]
                    >> > Is there a linux tool that uses as input my ugly C/C++ code and
                    >> > outputs a pretty and nice formated source code?[/color]
                    >>
                    >> Have you tried www.google.com?[/color]
                    >
                    > Believe me that I spend 15 minutes before asking here and I did not
                    > find anything... maybe I did not put the right words...[/color]

                    "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

                    Comment

                    • Richard Bos

                      #11
                      Re: C/C++ code beautifier

                      stevenkobes@hot mail.com (Steve Kobes) wrote:
                      [color=blue]
                      > Robert Gamble wrote:[color=green]
                      > > Assuming you mean C and/or C++, yes, there are many.[/color]
                      >
                      > Out of curiosity, when would C/C++ ever mean anything *other* than "C and/or C++"?[/color]

                      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

                      Comment

                      • Villy Kruse

                        #12
                        Re: C/C++ code beautifier

                        On Wed, 17 Nov 2004 00:07:23 -0800,
                        Ben Pfaff <blp@cs.stanfor d.edu> wrote:

                        [color=blue]
                        > diegoandresalva rez@lycos.co.uk (Diego Andres Alvarez Marin) writes:
                        >[color=green]
                        >> Victor Bazarov <v.Abazarov@com Acast.net> wrote in message news:<L6wmd.110 28$Ae.3905@news read1.dllstx09. us.to.verio.net >...[color=darkred]
                        >>> 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?[/color]
                        >>
                        >> Believe me that I spend 15 minutes before asking here and I did not
                        >> find anything... maybe I did not put the right words...[/color]
                        >
                        > "c beautifier" hits lots of useful programs and links.[/color]

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

                        Villy

                        Comment

                        • E. Robert Tisdale

                          #13
                          Re: C/C++ code beautifier

                          Diego Andres Alvarez Marin wrote:
                          [color=blue]
                          > Victor Bazarov wrote:
                          >[color=green]
                          >>Diego Andres Alvarez Marin wrote:
                          >>[color=darkred]
                          >>>Is there a linux tool that uses as input my ugly C/C++ code and
                          >>>outputs a pretty and nice formated source code?[/color]
                          >>
                          >>Have you tried www.google.com?[/color]
                          >
                          > Believe me that I spend 15 minutes before asking here
                          > and I did not find anything...[/color]

                          You should have told us that in your original post.
                          [color=blue]
                          > Maybe I did not put the right words...[/color]

                          I used Google

                          Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.


                          to search for

                          +"reformat C++"

                          and I found lots of stuff including:



                          [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

                          * 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 (cline@parashif t.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=%\|:v e=\|%:\
                          :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:

                          Comment

                          • Mark McIntyre

                            #14
                            Re: C/C++ code beautifier

                            On 16 Nov 2004 21:26:22 -0800, in comp.lang.c , stevenkobes@hot mail.com
                            (Steve Kobes) wrote:
                            [color=blue]
                            >Robert Gamble wrote:[color=green]
                            >> Assuming you mean C and/or C++, yes, there are many.[/color]
                            >
                            >Out of curiosity, when would C/C++ ever mean anything *other* than "C and/or C++"?[/color]

                            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 =----

                            Comment

                            • E. Robert Tisdale

                              #15
                              Re: C/C++ code beautifier

                              Steve Kobes wrote:
                              [color=blue]
                              > Robert Gamble wrote:
                              >[color=green]
                              >>Assuming you mean C and/or C++, yes, there are many.[/color]
                              >
                              >
                              > Out of curiosity, when would C/C++ ever mean anything *other* than "C and/or C++"?[/color]

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

                              Comment

                              Working...