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
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)