Category : C Source Code
Archive   : CPAREN.ZIP
Filename : CPAREN.DOC

Output of file : CPAREN.DOC contained in archive : CPAREN.ZIP

CPAREN(4/12/83) UNIX 5.0 (Tek local) CPAREN(4/12/83)

cparen - add parentheses to C expressions

cparen [ -t types ]

Written for those of us who can never remember the
precedence and associativity of operators in C, cparen reads
lines of C code from standard-in, adds parentheses to
indicate operator binding in expressions, then writes the
resultant code to standard-out.

The input code fragment need not contain complete
statements. For example, the following line is a valid
input to cparen:
} else if (x->d_prep > 56 && x->d_assoc == LEFT)

Normally, cparen considers identifiers in expressions to be
variable names. The -t option allows you to specify a
whitespace-separated list of types. For example,
cparen -t 'amap anop'
Declares "amap" and "anop" as type names rather than
variable names.

Exit status is 2 if cparen was invoked improperly, 1 if some
other error occurred, 0 if all went well.

Brad Needham, Tektronix, Inc.

Copyright (c) 1984 by Tektronix, Incorporated Beaverton,
Oregon 97077 All rights reserved.

Permission is hereby granted for personal, non-commercial
reproduction and use of this program, provided that this
notice is included in any copy.

Cparen assumes that the input code fragment came from a
syntactically correct C program -- it does not attempt to
give reasonable syntax-error messages.

Because cparen focuses on C statments it does not recognize
other constructs e.g. variable or function declarations.
It cannot process a whole C program.

The input is not filtered through the C preprocessor.

Page 1 (printed 10/16/89)

  3 Responses to “Category : C Source Code
Archive   : CPAREN.ZIP
Filename : CPAREN.DOC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: