Path: utzoo!attcan!uunet!vsi!friedl
From: friedl@vsi.UUCP (Stephen J. Friedl)
Newsgroups: comp.lang.c
Subject: Re: Unnecessary parenthesis
Summary: We use opchart(1)
Message-ID: <743@vsi.UUCP>
Date: 3 Jul 88 01:26:13 GMT
References: <326@marob.MASA.COM> <8209@brl-smoke.ARPA>
Organization: V-Systems, Inc. -- Santa Ana, CA
Lines: 40

In article <8209@brl-smoke.ARPA>, gwyn@brl-smoke.ARPA (Doug Gwyn ) writes:
> (Most C programmers I know have a copy of the chart from
> K&R 1st Ed. p. 49 taped up near their terminal.)

We've found it most helpful to have a little command "opchart"
that does this (and it fits on one screen quite nicely):

#------------------------ cut here ---------------------------
cat << 'EOF'

          C operator precedence/associativity chart

Arity       Operator                                    Assoc
--------------------------------------------------------------
binary    ()  []  ->  .                                 l -> r
unary     !   ~   ++  --  -  (type)  *  &  sizeof       r -> l
binary    *   /   %                                     l -> r
binary    +   -                                         l -> r
binary    <<  >>                                        l -> r
binary    <   <=  >   >=                                l -> r
binary    ==  !=                                        l -> r
binary    &                                             l -> r
binary    ^                                             l -> r
binary    |                                             l -> r
binary    &&                                            l -> r
binary    ||                                            l -> r
ternary   ?:                                            r -> l
binary    = += -= *= /= %= >>= <<= &= ^= |=             r -> l
binary    ,                                             l -> r
--------------------------------------------------------------
                                                From K&R, p 49
EOF

#------------------------ cut here ---------------------------

    Steve
-- 
Steve Friedl     V-Systems, Inc. (714) 545-6442     3B2-kind-of-guy
friedl@vsi.com     {backbones}!vsi.com!friedl    attmail!vsi!friedl
-----------Nancy Reagan on John DeLorean: "Just say snow"----------