public class strip_DEBUG extends Object
Use:
java strip_DEBUG [<source filename>]
Since Java does not provide preprocessor capabilities, debugging code sections can not be surrounded by #ifdef statements as they are in C/C++. For Java, then, the in-line code debugging technique assumed here is the use of a "DEBUG" marker to identify sequences of code that are only used for debugging purposes. This utility strips "DEBUG" sequences from a source code file.
A "DEBUG" sequence is identified by an expression containing the "DEBUG" marker. All source code lines containing the expression are stripped from the resultant output. The expression may be may be a variable or variable list which includes all members of the list, a method which includes the entire method definition, a conditional which includes the expression or expression block following the conditional, or any other expression. When expressions are stripped the entirertiy of all lines containing the expression are removed; thus "DEBUG" expressions must not be mixed with other expressions on the same line(s).
N.B.: The "DEBUG" string that is immediately preceded by a whitespace character, end of line sequence or left parenthesis character is taken to be contained in a "DEBUG" expression. Thus comments containing the unquoted word "DEBUG" will be mistaken for part of an expression resulting in incorrectly stripping the line on which "DEBUG" occurs and the expression following the comment (unless the commend contains characters that can misinterpreted as the end of an expression). The "DEBUG"
The sripped file is written to stdout. If no source filename is specified, it is read from stdin.
Constructor and Description |
---|
strip_DEBUG() |
public static final String ID
public static void main(String[] arguments)