]> www.ginac.de Git - ginac.git/commitdiff
replaced "precedence" static member variable by virtual precedence() function
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Sat, 19 May 2001 21:37:44 +0000 (21:37 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Sat, 19 May 2001 21:37:44 +0000 (21:37 +0000)
21 files changed:
ginac/add.cpp
ginac/add.h
ginac/basic.cpp
ginac/basic.h
ginac/container.pl
ginac/expairseq.cpp
ginac/expairseq.h
ginac/function.pl
ginac/mul.cpp
ginac/mul.h
ginac/ncmul.cpp
ginac/ncmul.h
ginac/numeric.cpp
ginac/numeric.h
ginac/power.cpp
ginac/power.h
ginac/pseries.cpp
ginac/pseries.h
ginac/registrar.h
ginac/relational.cpp
ginac/relational.h

index 412bd5a548e65cffab65f1fd3379c7aed137bc03..92cb325fe04c00db04e0875c55774c9ed7856f38 100644 (file)
@@ -121,7 +121,7 @@ void add::print(const print_context & c, unsigned level) const
 
        } else if (is_of_type(c, print_csrc)) {
 
-               if (precedence <= level)
+               if (precedence() <= level)
                        c.s << "(";
        
                // Print arguments, separated by "+"
@@ -130,23 +130,23 @@ void add::print(const print_context & c, unsigned level) const
                
                        // If the coefficient is -1, it is replaced by a single minus sign
                        if (it->coeff.compare(_num1()) == 0) {
-                               it->rest.bp->print(c, precedence);
+                               it->rest.bp->print(c, precedence());
                        } else if (it->coeff.compare(_num_1()) == 0) {
                                c.s << "-";
-                               it->rest.bp->print(c, precedence);
+                               it->rest.bp->print(c, precedence());
                        } else if (ex_to_numeric(it->coeff).numer().compare(_num1()) == 0) {
-                               it->rest.bp->print(c, precedence);
+                               it->rest.bp->print(c, precedence());
                                c.s << "/";
-                               ex_to_numeric(it->coeff).denom().print(c, precedence);
+                               ex_to_numeric(it->coeff).denom().print(c, precedence());
                        } else if (ex_to_numeric(it->coeff).numer().compare(_num_1()) == 0) {
                                c.s << "-";
-                               it->rest.bp->print(c, precedence);
+                               it->rest.bp->print(c, precedence());
                                c.s << "/";
-                               ex_to_numeric(it->coeff).denom().print(c, precedence);
+                               ex_to_numeric(it->coeff).denom().print(c, precedence());
                        } else {
-                               it->coeff.bp->print(c, precedence);
+                               it->coeff.bp->print(c, precedence());
                                c.s << "*";
-                               it->rest.bp->print(c, precedence);
+                               it->rest.bp->print(c, precedence());
                        }
                
                        // Separator is "+", except if the following expression would have a leading minus sign
@@ -158,15 +158,15 @@ void add::print(const print_context & c, unsigned level) const
                if (!overall_coeff.is_zero()) {
                        if (overall_coeff.info(info_flags::positive))
                                c.s << '+';
-                       overall_coeff.bp->print(c, precedence);
+                       overall_coeff.bp->print(c, precedence());
                }
        
-               if (precedence <= level)
+               if (precedence() <= level)
                        c.s << ")";
 
        } else {
 
-               if (precedence <= level) {
+               if (precedence() <= level) {
                        if (is_of_type(c, print_latex))
                                c.s << "{(";
                        else
@@ -181,7 +181,7 @@ void add::print(const print_context & c, unsigned level) const
                        if (!is_of_type(c, print_tree))
                                overall_coeff.print(c, 0);
                        else
-                               overall_coeff.print(c, precedence);
+                               overall_coeff.print(c, precedence());
                        first = false;
                }
 
@@ -204,20 +204,20 @@ void add::print(const print_context & c, unsigned level) const
                                                coeff.print(c);
                                } else {
                                        if (coeff.csgn() == -1)
-                                               (-coeff).print(c, precedence);
+                                               (-coeff).print(c, precedence());
                                        else
-                                               coeff.print(c, precedence);
+                                               coeff.print(c, precedence());
                                }
                                if (is_of_type(c, print_latex))
                                        c.s << ' ';
                                else
                                        c.s << '*';
                        }
-                       it->rest.print(c, precedence);
+                       it->rest.print(c, precedence());
                        it++;
                }
 
-               if (precedence <= level) {
+               if (precedence() <= level) {
                        if (is_of_type(c, print_latex))
                                c.s << ")}";
                        else
@@ -468,12 +468,4 @@ ex add::expand(unsigned options) const
        return (new add(vp,overall_coeff))->setflag(status_flags::expanded | status_flags::dynallocated);
 }
 
-//////////
-// static member variables
-//////////
-
-// protected
-
-unsigned add::precedence = 40;
-
 } // namespace GiNaC
index c6d04d0829e0614166d4886285d8c48505f51673..1e036627c68c8d39bbc37c25e944490c827e7e2c 100644 (file)
@@ -47,6 +47,7 @@ public:
        // functions overriding virtual functions from bases classes
 public:
        void print(const print_context & c, unsigned level = 0) const;
+       unsigned precedence(void) const {return 40;}
        bool info(unsigned inf) const;
        int degree(const ex & s) const;
        int ldegree(const ex & s) const;
@@ -73,17 +74,6 @@ protected:
                                               const ex & c) const;
        ex recombine_pair_to_ex(const expair & p) const;
        ex expand(unsigned options=0) const;
-       
-       // new virtual functions which can be overridden by derived classes
-       // none
-       
-       // non-virtual functions in this class
-       // none
-
-// member variables
-
-protected:
-       static unsigned precedence;
 };
 
 // utility functions
index 5b0b180378bc24df6bd95dbf671ece9f95bc6e56..bf5bd6cb02b0d1c89e8b87acdc000a0913108ebb 100644 (file)
@@ -154,6 +154,12 @@ void basic::dbgprinttree(void) const
        this->print(print_tree(std::cerr));
 }
 
+/** Return relative operator precedence (for parenthizing output). */
+unsigned basic::precedence(void) const
+{
+       return 70;
+}
+
 /** Create a new copy of this on the heap.  One can think of this as simulating
  *  a virtual copy constructor which is needed for instance by the refcounted
  *  construction of an ex from a basic. */
@@ -635,14 +641,6 @@ void basic::ensure_if_modifiable(void) const
                throw(std::runtime_error("cannot modify multiply referenced object"));
 }
 
-//////////
-// static member variables
-//////////
-
-// protected
-
-unsigned basic::precedence = 70;
-
 //////////
 // global variables
 //////////
index 555d35cfaf0cbb49a01dbe008c2ca31a9cb7a05e..33a9d207ebaed981c8a1b1f7f566b97e4c99b37d 100644 (file)
@@ -103,6 +103,7 @@ public: // only const functions please (may break reference counting)
        virtual void print(const print_context & c, unsigned level = 0) const;
        virtual void dbgprint(void) const;
        virtual void dbgprinttree(void) const;
+       virtual unsigned precedence(void) const;
        virtual bool info(unsigned inf) const;
        virtual unsigned nops() const;
        virtual ex op(int i) const;
@@ -162,7 +163,6 @@ protected:
        unsigned tinfo_key;                 ///< typeinfo
        mutable unsigned flags;             ///< of type status_flags
        mutable unsigned hashvalue;         ///< hash value
-       static unsigned precedence;         ///< precedence for printing parens
 private:
        unsigned refcount;                  ///< Number of reference counts
 };
index af9d5372ba4616cb441ed5c399a090c776fd490c..8a025033a76a62f3f2f0e9571c5b3ba47bbf25e7 100755 (executable)
@@ -206,6 +206,7 @@ ${constructors_interface}
 
 public:
        void print(const print_context & c, unsigned level = 0) const;
+       unsigned precedence(void) const {return 10;}
        bool info(unsigned inf) const;
        unsigned nops() const;
        ex & let_op(int i);
@@ -241,7 +242,6 @@ protected:
 
 protected:
        ${STLT} seq;
-       static unsigned precedence;
 };
 
 // utility functions
@@ -418,7 +418,7 @@ void ${CONTAINER}::print(const print_context & c, unsigned level) const
 
        } else {
                // always print brackets around seq, ignore upper_precedence
-               printseq(c, '${open_bracket}', ',', '${close_bracket}', precedence, precedence+1);
+               printseq(c, '${open_bracket}', ',', '${close_bracket}', precedence(), precedence()+1);
        }
 }
 
@@ -726,14 +726,6 @@ ${STLT} * ${CONTAINER}::subschildren(const lst & ls, const lst & lr) const
        return 0; // nothing has changed
 }
 
-//////////
-// static member variables
-//////////
-
-// protected
-
-unsigned ${CONTAINER}::precedence = 10;
-
 } // namespace GiNaC
 
 END_OF_IMPLEMENTATION
index b6a0f372adb8e762abb4d7ff541b53b54b6d6ddb..b14ffb3027e7b72c61ae4642306fece67def22aa 100644 (file)
@@ -267,7 +267,7 @@ void expairseq::print(const print_context & c, unsigned level) const
 
        } else {
                c.s << "[[";
-               printseq(c, ',', precedence, level);
+               printseq(c, ',', precedence(), level);
                c.s << "]]";
        }
 }
@@ -540,9 +540,9 @@ ex expairseq::thisexpairseq(epvector *vp, const ex &oc) const
 void expairseq::printpair(const print_context & c, const expair & p, unsigned upper_precedence) const
 {
        c.s << "[[";
-       p.rest.bp->print(c, precedence);
+       p.rest.bp->print(c, precedence());
        c.s << ",";
-       p.coeff.bp->print(c, precedence);
+       p.coeff.bp->print(c, precedence());
        c.s << "]]";
 }
 
@@ -1631,10 +1631,6 @@ epvector * expairseq::subschildren(const lst &ls, const lst &lr) const
 // static member variables
 //////////
 
-// protected
-
-unsigned expairseq::precedence = 10;
-
 #if EXPAIRSEQ_USE_HASHTAB
 unsigned expairseq::maxhashtabsize = 0x4000000U;
 unsigned expairseq::minhashtabsize = 0x1000U;
index e4e34653f33ff273774aa91937a5fb1cbdda5a0c..fac36eec47072e41080e68b7559818b8517ba061 100644 (file)
@@ -88,6 +88,7 @@ public:
 public:
        basic * duplicate() const;
        void print(const print_context & c, unsigned level = 0) const;
+       unsigned precedence(void) const {return 10;}
        bool info(unsigned inf) const;
        unsigned nops() const;
        ex op(int i) const;
@@ -174,7 +175,6 @@ protected:
 protected:
        epvector seq;
        ex overall_coeff;
-       static unsigned precedence;
 #if EXPAIRSEQ_USE_HASHTAB
        epplistvector hashtab;
        unsigned hashtabsize;
index 9e303d070196a0d06d3ced1a9ef7c80f297cbdc0..a08d35f11f507d61e963048e9d8a329f989aa5c2 100755 (executable)
@@ -335,6 +335,7 @@ $constructors_interface
        // functions overriding virtual functions from bases classes
 public:
        void print(const print_context & c, unsigned level = 0) const;
+       unsigned precedence(void) const {return 70;}
        int degree(const ex & s) const;
        int ldegree(const ex & s) const;
        ex coeff(const ex & s, int n = 1) const;
@@ -678,10 +679,10 @@ void function::print(const print_context & c, unsigned level) const
 
        } else if is_of_type(c, print_latex) {
                c.s << registered_functions()[serial].TeX_name;
-               printseq(c, '(', ',', ')', exprseq::precedence, function::precedence);
+               printseq(c, '(', ',', ')', exprseq::precedence(), function::precedence());
        } else {
                c.s << registered_functions()[serial].name;
-               printseq(c, '(', ',', ')', exprseq::precedence, function::precedence);
+               printseq(c, '(', ',', ')', exprseq::precedence(), function::precedence());
        }
 }
 
index efc207bb90c91d22e72a5707b499e1a8ddf2236d..8e641caf2ddec551ccfd6f86308649b5690b9d06 100644 (file)
@@ -136,11 +136,11 @@ void mul::print(const print_context & c, unsigned level) const
 
        } else if (is_of_type(c, print_csrc)) {
 
-               if (precedence <= level)
+               if (precedence() <= level)
                        c.s << "(";
 
                if (!overall_coeff.is_equal(_ex1())) {
-                       overall_coeff.bp->print(c, precedence);
+                       overall_coeff.bp->print(c, precedence());
                        c.s << "*";
                }
        
@@ -158,7 +158,7 @@ void mul::print(const print_context & c, unsigned level) const
 
                        // If the exponent is 1 or -1, it is left out
                        if (it->coeff.compare(_ex1()) == 0 || it->coeff.compare(_num_1()) == 0)
-                               it->rest.print(c, precedence);
+                               it->rest.print(c, precedence());
                        else {
                                // Outer parens around ex needed for broken gcc-2.95 parser:
                                (ex(power(it->rest, abs(ex_to_numeric(it->coeff))))).print(c, level);
@@ -174,12 +174,12 @@ void mul::print(const print_context & c, unsigned level) const
                        }
                }
 
-               if (precedence <= level)
+               if (precedence() <= level)
                        c.s << ")";
 
        } else {
 
-               if (precedence <= level) {
+               if (precedence() <= level) {
                        if (is_of_type(c, print_latex))
                                c.s << "{(";
                        else
@@ -201,9 +201,9 @@ void mul::print(const print_context & c, unsigned level) const
                                        coeff.print(c);
                        } else {
                                if (coeff.csgn() == -1)
-                                       (-coeff).print(c, precedence);
+                                       (-coeff).print(c, precedence());
                                else
-                                       coeff.print(c, precedence);
+                                       coeff.print(c, precedence());
                        }
                        if (is_of_type(c, print_latex))
                                c.s << ' ';
@@ -222,11 +222,11 @@ void mul::print(const print_context & c, unsigned level) const
                        } else {
                                first = false;
                        }
-                       recombine_pair_to_ex(*it).print(c, precedence);
+                       recombine_pair_to_ex(*it).print(c, precedence());
                        it++;
                }
 
-               if (precedence <= level) {
+               if (precedence() <= level) {
                        if (is_of_type(c, print_latex))
                                c.s << ")}";
                        else
@@ -717,12 +717,4 @@ epvector * mul::expandchildren(unsigned options) const
        return 0; // nothing has changed
 }
 
-//////////
-// static member variables
-//////////
-
-// protected
-
-unsigned mul::precedence = 50;
-
 } // namespace GiNaC
index 2d3d240f459307d3016cea9567ce7f5763cae560..d5a73ccf27ea1f188ff6e347a37fe07a768ba9f7 100644 (file)
@@ -48,6 +48,7 @@ public:
        // functions overriding virtual functions from bases classes
 public:
        void print(const print_context & c, unsigned level = 0) const;
+       unsigned precedence(void) const {return 50;}
        bool info(unsigned inf) const;
        int degree(const ex & s) const;
        int ldegree(const ex & s) const;
@@ -85,11 +86,6 @@ protected:
        // non-virtual functions in this class
 protected:
        epvector * expandchildren(unsigned options) const;
-       
-// member variables
-       
-protected:
-       static unsigned precedence;
 };
 
 // utility functions
index abe72ef1f726e64e560ebaca45061d3f4ddc04e9..8a0cc1220311d5eb7c0070fb76dd552e1ba28813 100644 (file)
@@ -126,15 +126,15 @@ void ncmul::print(const print_context & c, unsigned level) const
                c.s << "ncmul(";
                exvector::const_iterator it = seq.begin(), itend = seq.end()-1;
                while (it != itend) {
-                       it->print(c, precedence);
+                       it->print(c, precedence());
                        c.s << ",";
                        it++;
                }
-               it->print(c, precedence);
+               it->print(c, precedence());
                c.s << ")";
 
        } else
-               printseq(c, '(', '*', ')', precedence, level);
+               printseq(c, '(', '*', ')', precedence(), level);
 }
 
 bool ncmul::info(unsigned inf) const
@@ -530,14 +530,6 @@ const exvector & ncmul::get_factors(void) const
        return seq;
 }
 
-//////////
-// static member variables
-//////////
-
-// protected
-
-unsigned ncmul::precedence = 50;
-
 //////////
 // friend functions
 //////////
index 05b96da375d2e72936195ba9bef5976367d1307d..f3fc1019dcb5df152cafb8ca1034971ab3a0ac5d 100644 (file)
@@ -54,6 +54,7 @@ public:
        // functions overriding virtual functions from bases classes
 public:
        void print(const print_context & c, unsigned level = 0) const;
+       unsigned precedence(void) const {return 50;}
        bool info(unsigned inf) const;
        int degree(const ex & s) const;
        int ldegree(const ex & s) const;
@@ -78,11 +79,6 @@ protected:
        exvector expandchildren(unsigned options) const;
 public:
        const exvector & get_factors(void) const;
-
-// member variables
-
-protected:
-       static unsigned precedence;
 };
 
 // friend funtions 
index ef4e3e929ce5732f854bfae80d3f72f9f55e2b34..a89045bd3d310deeb61aff0a18a8a9d54cf3dee4 100644 (file)
@@ -418,7 +418,7 @@ void numeric::print(const print_context & c, unsigned level) const
                const cln::cl_R i = cln::imagpart(cln::the<cln::cl_N>(value));
                if (cln::zerop(i)) {
                        // case 1, real:  x  or  -x
-                       if ((precedence <= level) && (!this->is_nonneg_integer())) {
+                       if ((precedence() <= level) && (!this->is_nonneg_integer())) {
                                c.s << par_open;
                                print_real_number(c.s, r);
                                c.s << par_close;
@@ -428,7 +428,7 @@ void numeric::print(const print_context & c, unsigned level) const
                } else {
                        if (cln::zerop(r)) {
                                // case 2, imaginary:  y*I  or  -y*I
-                               if ((precedence <= level) && (i < 0)) {
+                               if ((precedence() <= level) && (i < 0)) {
                                        if (i == -1) {
                                                c.s << par_open+imag_sym+par_close;
                                        } else {
@@ -450,7 +450,7 @@ void numeric::print(const print_context & c, unsigned level) const
                                }
                        } else {
                                // case 3, complex:  x+y*I  or  x-y*I  or  -x+y*I  or  -x-y*I
-                               if (precedence <= level)
+                               if (precedence() <= level)
                                        c.s << par_open;
                                print_real_number(c.s, r);
                                if (i < 0) {
@@ -469,7 +469,7 @@ void numeric::print(const print_context & c, unsigned level) const
                                                c.s << mul_sym+imag_sym;
                                        }
                                }
-                               if (precedence <= level)
+                               if (precedence() <= level)
                                        c.s << par_close;
                        }
                }
@@ -1148,15 +1148,6 @@ int numeric::int_length(void) const
                return 0;
 }
 
-
-//////////
-// static member variables
-//////////
-
-// protected
-
-unsigned numeric::precedence = 30;
-
 //////////
 // global constants
 //////////
index 4f2ba1a1e3b4fa9c7c147f8f5082e27513e6357f..1cd7d976dfaefd1eca9f3b6d029a1c764065813e 100644 (file)
@@ -85,6 +85,7 @@ public:
        // functions overriding virtual functions from bases classes
 public:
        void print(const print_context & c, unsigned level = 0) const;
+       unsigned precedence(void) const {return 30;}
        bool info(unsigned inf) const;
        bool has(const ex &other) const;
        ex eval(int level = 0) const;
@@ -160,7 +161,6 @@ public:
 // member variables
 
 protected:
-       static unsigned precedence;
        cln::cl_number value;
 };
 
index b13665e18c0bbb0a286969f528ae88279620f756..eee137bb0cddaebf3c096bc5e03fbdeaa63ba570 100644 (file)
@@ -189,16 +189,16 @@ void power::print(const print_context & c, unsigned level) const
                        else
                                c.s << ")";
                } else {
-                       if (precedence <= level) {
+                       if (precedence() <= level) {
                                if (is_of_type(c, print_latex))
                                        c.s << "{(";
                                else
                                        c.s << "(";
                        }
-                       basis.print(c, precedence);
+                       basis.print(c, precedence());
                        c.s << "^";
-                       exponent.print(c, precedence);
-                       if (precedence <= level) {
+                       exponent.print(c, precedence());
+                       if (precedence() <= level) {
                                if (is_of_type(c, print_latex))
                                        c.s << ")}";
                                else
@@ -830,14 +830,6 @@ ex power::expand_noncommutative(const ex & basis, const numeric & exponent,
 }
 */
 
-//////////
-// static member variables
-//////////
-
-// protected
-
-unsigned power::precedence = 60;
-
 // helper function
 
 ex sqrt(const ex & a)
index d9748ef93adfc9590f51a666f18f204eef6a634b..480e091ab3766fa236ef6cddf3ab3d108f210643 100644 (file)
@@ -49,6 +49,7 @@ public:
        // functions overriding virtual functions from bases classes
 public:
        void print(const print_context & c, unsigned level = 0) const;
+       unsigned precedence(void) const {return 60;}
        bool info(unsigned inf) const;
        unsigned nops() const;
        ex & let_op(int i);
@@ -86,7 +87,6 @@ protected:
 protected:
        ex basis;
        ex exponent;
-       static unsigned precedence;
 };
 
 // utility functions
index ffb2cfb98125d658cbaeb1be9a2b13e60aeab34c..9d04f6a996346d42e5d60dd603702105a9b9867b 100644 (file)
@@ -142,7 +142,7 @@ void pseries::print(const print_context & c, unsigned level) const
 
        } else {
 
-               if (precedence <= level)
+               if (precedence() <= level)
                        c.s << "(";
                
                std::string par_open = is_of_type(c, print_latex) ? "{(" : "(";
@@ -198,7 +198,7 @@ void pseries::print(const print_context & c, unsigned level) const
                                Order(power(var-point,i->coeff)).print(c);
                }
 
-               if (precedence <= level)
+               if (precedence() <= level)
                        c.s << ")";
        }
 }
@@ -925,12 +925,4 @@ ex ex::series(const ex & r, int order, unsigned options) const
        return e;
 }
 
-//////////
-// static member variables
-//////////
-
-// protected
-
-unsigned pseries::precedence = 38;  // for clarity just below add::precedence
-
 } // namespace GiNaC
index 345a5fd2d877ef7926cade4d23d80e07f737d59a..18baed39f36461792a5849110762f46475a4cded 100644 (file)
@@ -43,6 +43,7 @@ public:
        // functions overriding virtual functions from base classes
 public:
        void print(const print_context & c, unsigned level = 0) const;
+       unsigned precedence(void) const {return 38;} // for clarity just below add::precedence
        unsigned nops(void) const;
        ex op(int i) const;
        ex &let_op(int i);
@@ -98,8 +99,6 @@ protected:
 
        /** Expansion point */
        ex point;
-
-       static unsigned precedence;
 };
 
 /** Return a reference to the pseries object embedded in an expression.
index 8cab2031a010cf57e9918fb4e73f74eab13c30b0..125d0998903a6950f368a4f2898dd7213b9d330d 100644 (file)
@@ -81,7 +81,6 @@ public: \
        classname(const classname & other); \
        const classname & operator=(const classname & other); \
        basic * duplicate() const; \
-       unsigned get_precedence(void) const {return precedence;} \
 protected: \
        void copy(const classname & other); \
        void destroy(bool call_parent); \
index 51fd0f18ef9865b38b7ad91e908c74b81b24a757..7f6337d2907d3a282693a90b44bd4a6940528439 100644 (file)
@@ -107,9 +107,9 @@ void relational::print(const print_context & c, unsigned level) const
 
        } else {
 
-               if (precedence <= level)
+               if (precedence() <= level)
                        c.s << "(";
-               lh.print(c, precedence);
+               lh.print(c, precedence());
                switch (o) {
                case equal:
                        c.s << "==";
@@ -132,8 +132,8 @@ void relational::print(const print_context & c, unsigned level) const
                default:
                        c.s << "(INVALID RELATIONAL OPERATOR)";
                }
-               rh.print(c, precedence);
-               if (precedence <= level)
+               rh.print(c, precedence());
+               if (precedence() <= level)
                        c.s << ")";
        }
 }
@@ -282,12 +282,4 @@ relational::operator bool() const
        }
 }
 
-//////////
-// static member variables
-//////////
-
-// protected
-
-unsigned relational::precedence = 20;
-
 } // namespace GiNaC
index dcbcacc5a30bc2e36d40cc99577bca749a844f1a..c3b223b5eb0f494f722ffc25f20a10ce72de5431 100644 (file)
@@ -52,6 +52,7 @@ public:
        // functions overriding virtual functions from bases classes
 public:
        void print(const print_context & c, unsigned level = 0) const;
+       unsigned precedence(void) const {return 20;}
        bool info(unsigned inf) const;
        unsigned nops() const;
        ex & let_op(int i);
@@ -78,7 +79,6 @@ protected:
        ex lh;
        ex rh;
        operators o;
-       static unsigned precedence;
 };
 
 // utility functions