MainComputersProgrammingLanguages › xtractCode.pl

xtractCode.pl

Edit Page
Report
Scan day: 16 February 2014 UTC
-103
Virus safety - good
Description: Extracts code snippets from source code for presenting code in parts, e.g., when printing code snippets with LaTeX.
#!/usr/bin/perl -w # # $Id: xtractCode.pl,v 1.38 2003/04/04 15:28:46 robert Exp $ # # Robert Wenner ([email protected]) # # History: # 2002-10-09 First working code. Unindent feature. Customizable prefix and # suffix. # 2002-10-25 Allowed adding file contents as prefix and suffix. # 2002-11-07 Duplicate labels may be used. # 2002-11-11 Added introLabel / outroLabel. Made file name prefix and # suffix customizable. # 2002-11-25 Issues warning on unindenting "strange" formatted code. # Allowed config comments in the parsed files. # Implemented --append option. # 2002-11-30 Some refactorings and bug fixes. # 2002-12-07 Added --indentation and --language options and configurable # markers. Allowed defining comments on the fly. # 2003-01-15 Broke code up into sub routines. Added --error option. # Added --blanklines option. # 2003-02-?? Further code refinement into subs. Replaced die with error # calls for better error handling. # 2003-02-12 Added --version option. Added --fail option. # 2003-02-15 Refactored into subs, bundled snippet information in hash # of hashes. Changed intro / outro to be written just in before # exiting. # 2003-02-16 Appended $prefix to intro and outro label files, too. # 2003-02-17 Added more default extensions (thanks to Holger Jakobs). # 2003-02-20 Added missing documentation. Fixed problem with empty intro # or outro files in combination with prefix and suffix. Fixed # problem with missing file name extensions. # 2003-03-08 Added --makedep option. # 2003-03-29 Fixed end of comment detection for xtract markers. # Split --comment option in --commentStart and --commentStop. # # Todo: # - Allow (properly) nested label blocks? # - Allow multiple xtractStart and xtractStop labels in one comment? # - Allow more than one comment per line? # - Allow config file ~/.xtractCode.conf? # - Get some unit tests in place! # - Allow extracting only snippets given on command line? # - Optionally remove all comments from input. (Nested?) # use strict; use Getopt::Long; use Pod::Usage; use Text::ParseW
Size: 2048 chars

Contact Information

Email:
Phone&Fax:
Address:
Extended:

WEBSITE Info

Page title:
Keywords:
Description:
IP-address:212.117.177.118