in reply to Text Wrapping

You can certainly do it in Perl but why bother? Google for 'pretty print C++' to find all sort of ready made solutions. Like http://www.softpanorama.org/Tools/beautifiers.shtml Here is one in C++ ASBeautifier.cpp

Perl has all sorts of great pre rolled libraies with amazing coverage at the CPAN (Comprehensive Perl Archive Nework) http://cpan.org For example there is Text::Wrap but I would go with a C++ pre-coded beutifier unless you want to have a fun and useful Perl project to tool around with. You may like stuff like Inline:CPP which will let you embed C++ into your Perl so you can mix and match.

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Replies are listed 'Best First'.
Re: Re: Text Wrapping
by hehenoobhehe (Novice) on Oct 22, 2003 at 09:04 UTC
    Thanks Tachyon!

    I explored the option (as suggested by you) to use a C++ pre coded beautifier and I discovered the following:

    1) I am unable to get the ENTIRE source code for ASBeautifier and get some obvious compiler errors because of missing source code.

    2) From the link here: http://www.softpanorama.org/Tools/beautifiers.shtml , I checked out the program namely: Artistic Style 1.13.8 but from the options provided, I ascertain that this program is only for formatting and indentation and these do meet my requirements as well BUT I dont see how I could use this for a specific objective that I have in mind:

    "The length of each line of code (that can be compiled by a standard C++ compiler) must NOT exceed 78 characters" Maybe I need to play around a bit with this program in order to get the desired results or maybe add my own code to get this feature going.

    Have you used the program?

      It is on source forge, now called astyle which contains ASBeautifier plus all the headers and docs. http://sourceforge.net/projects/astyle Try compiling it and running it on some of your code, you may be pleasantly surprised (aka it manages line lengths automatically).....

      Release Notes In Artistic Style 0.9.2 (24 November 1998) Fixed a serious bug which led to a maximal supported source code line +size of 128 characters!!!

      :-)

      cheers

      tachyon

      s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Re: Re: Text Wrapping
by Anonymous Monk on Oct 23, 2003 at 07:24 UTC
    ASBeautifier.cpp is just _one_ sourcefile of a package. Of course you cannot compile it without the whole AStyle class. Go to the download section of the site and get the whole thing.

      Yes, some people! aka No shit Sherlock. You give some pople as Silver spoon and they expect you to feed them too!

      cheers

      tachyon

      s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print