."\ Master source for brackets manual : /usr/src/local/man/src/brackets.rof .TH BRACKETS P " V1.1 29 JUNE 89 for Prog. V2.9" "Julian Stacey" "Julian Stacey, Vector Systems Ltd" .\" A4 the cludgy way. .pl 29.6c .UC 4 .SH NAME brackets \- Produce listing to help find C syntax errors. .SH SYNTAX .B brackets [-t] [-c] [-w] [-p] files .SH DESCRIPTION .I Brackets is not a standard Unix command, it is unique to VSL systems with the Ournix overlay. Lists to stdout a count at the beginning of each line of the current nesting level for () {} [] /* and */ calculated after scanning up to the end of line. A C or T character indicates whether .I brackets considers the end of the line to be C Code or Text comment. The line of source text is appended in the listing after the count (which starts on the left margin). 2 sets of counts are printed :- .in +4 The first treating the whole file as arbitrary text, with no knowledge of slash star as a C comment delimeter. .br The second just for code areas of the file. .in -4 Both counts may be individually turned off, by default they are both on. .br The following are catered for:- .\" "()" and "''" .\" '\'' and "\"hallo\"" ' .\" '\\' and "hallo\\" .in +4 "()" and "''" .br '\\'' and "\\"hallo\\"" .br '\\\\' and "hallo\\\\" .in -4 This program does not allow for nested comments (nested comments are/were found in some dialects of C), a single */ is assumed to return to the code. The output (to ) produced by .I brackets remains suitable for scanning by bracket matching editors such as .I vi, using the % match key; but is not itself compilable. Also useful for finding unmatched brackets in things like makefiles. .SH OPTIONS .TP .B \-t Turn off display for 'all file' area. .TP .B \-c Turn off display for 'code only' area. .TP .B \-w Turn off summary warnings. .TP .B \-p Turn off print of lines during analysis. .SH EXIT CODE 0 if all files are accessible, and all code totals were 0, else 1, (non zero totals for brackets in text are not considered serious enough to warrant returning an error status). .SH ENHANCEMENTS POSSIBLE Preprocessor conditional such as : .in +4 #if #ifndef #ifdef .in -4 are not evaluated, these must be done by a manual .ti +4 cc -P -i .br preceeding usage of .I brackets. .br Back slash cr is not catered for. .SH EXAMPLE An input data file containing this .in +4 .nf main() { if (sometimes) { printf(hallo"); } .fi .in -4 when read by .I brackets produces this output: .in +4 .nf /*0:0:C*/{1:1}(0:0)[0:0]"0:0"`0:0`'0:0'|main() { /*0:0:C*/{1:1}(0:0)[0:0]"0:0"`0:0`'0:0'| if (sometimes) /*0:0:C*/{2:2}(0:0)[0:0]"0:0"`0:0`'0:0'| { /*0:0:C*/{2:2}(0:1)[0:0]"1:1"`0:0`'0:0'| printf(hallo"); /*0:0:C*/{2:2}(0:1)[0:0]"1:1"`0:0`'0:0'| /*0:0:C*/{1:2}(0:1)[0:0]"1:1"`0:0`'0:0'| } Count pairs represent end of adjacent lines :- 1st count: Whole file as arbitrary text, ignoring / & * 2nd count: Only C code areas of file, recognising / & * sequences Warning: One or more symbols in Text is not matched. Error: One or more symbols in Code is not matched. .fi .in -4 .SH HOST OP SYSTEM This utility runs on both Msdos 3.2 & Unix UCB BSD 4.2. .SH AUTHOR Program Copyright Julian H. Stacey, Munich 1988 .br Document Copyright Julian H. Stacey, Munich 1996 .\" earlier actually, but when ? .so author.jhs .SH SEE ALSO vi(1), lint(1). .\ End of file