#! /bin/sh
patch --remove-empty-files -p0 -i "$0" "$@"
exit $?

--- ./doc/yacc2tex.yy
+++ ./doc/yacc2tex.yy	2004-03-16 16:54:48.000000000 +0100
@@ -38,6 +38,7 @@
 #include <iostream>
 #include <fstream>
 #include <string>
+using namespace std;
 
 namespace { // pedantic... :-7
 
--- ./src/Makefile.in
+++ ./src/Makefile.in	2004-03-16 15:40:15.000000000 +0100
@@ -7,7 +7,7 @@
 # The flags for the C++ compiler are for gcc 2.95 - will need adjusting
 # for other compilers. (-W* = enable warnings.)
 CXX =		@CXX@
-CXXFLAGS =	@CPPFLAGS@ -Wall -W -Wpointer-arith -Wbad-function-cast -Wconversion -Wmissing-prototypes -Woverloaded-virtual @CXXFLAGS@ -DVERSION_NR="\"@VERSION_NR@\"" @DEFS@ -O0 $(X) # -DDEBUG -Winline -ggdb
+CXXFLAGS =	@CPPFLAGS@ -Wall -W -Wpointer-arith -Wconversion -Wmissing-prototypes -Woverloaded-virtual @CXXFLAGS@ -DVERSION_NR="\"@VERSION_NR@\"" @DEFS@ -O0 $(X) # -DDEBUG -Winline -ggdb
 LD =		@CXX@
 LDFLAGS =	@LIBS@ @LDFLAGS@
 
--- ./src/bigint.h
+++ ./src/bigint.h	2004-03-16 15:25:54.000000000 +0100
@@ -20,6 +20,7 @@
 
 #include <cstddef>
 #include <iostream>
+using namespace std;
 //______________________________________________________________________
 
 class BigInt {
--- ./src/cmdopt.h
+++ ./src/cmdopt.h	2004-03-16 15:48:07.000000000 +0100
@@ -21,6 +21,7 @@
 #endif
 #include <iosfwd>
 #include <string>
+using namespace std;
 
 #include "debug.h"
 #include "partfwd.h"
@@ -32,7 +33,6 @@
   static void printUsage();
   static inline const char* binaryName() { return binaryNameVal; }
 
-private:
   static const char* binaryNameVal; // name of executable
   class Global {
     friend int main(int argc, char* argv[]);
--- ./src/error.h
+++ ./src/error.h	2004-03-16 15:27:23.000000000 +0100
@@ -16,6 +16,7 @@
 
 #include <iosfwd>
 #include <string>
+using namespace std;
 
 /* Line number information. Could be extended to include column nr. or
    file name. Must not have ctor, because it is stored in union. :-/ */
--- ./src/lex.yy
+++ ./src/lex.yy	2004-03-16 17:15:07.000000000 +0100
@@ -81,7 +81,12 @@
 
 // initialise hash table
 struct Singleton_InitHash : private DebugSingleton {
-  static const int values[] = {
+  static const int values[];
+  static const char* const keywords[];
+  inline Singleton_InitHash();
+  inline ~Singleton_InitHash();
+} singleton_InitHash;
+const int Singleton_InitHash::values[] = {
     MUNION, PSUBSET, SUBSET, DINTER, DUNION, INVERSE, POWER, SEQ, OF,
     SEQ1, INMAP, MAP, IOTA, LAMBDA, MU, BOOL, NAT, NAT1, INT, RAT,
     REAL, INTER, UNION, SET, COMP, AND, OR, FORALL, EXISTS, EXISTS1,
@@ -98,7 +103,7 @@
     // multi-word symbols do not have keyword[] entry
     IN_SET
   };
-  static const char* const keywords[] = {
+const char* const Singleton_InitHash::keywords[] = {
     "munion", "psubset", "subset", "dinter", "dunion", "inverse",
     "power", "seq", "of", "seq1", "inmap", "map", "iota", "lambda",
     "mu", "bool", "nat", "nat1", "int", "rat", "real", "inter",
@@ -115,20 +120,18 @@
     "tixe", "token", "tl", "to", "trap", "true", "types", "undefined",
     "using", "values", "while", "wr"
   };
-  Singleton_InitHash() {
+
+  Singleton_InitHash::Singleton_InitHash() {
     for (size_t i = 0; i < sizeof(keywords) / sizeof(char*); ++i)
       hashTab[new IdToken(values[i], keywords[i])];
   }
-  ~Singleton_InitHash() {
+  Singleton_InitHash::~Singleton_InitHash() {
     Lex::IdToken::allowDelete();
     for (myhashmap::iterator i = hashTab.begin(), e = hashTab.end();
          i != e; ++i)
       delete i->first;
     Lex::IdToken::denyDelete();
   }
-} singleton_InitHash;
-const int Singleton_InitHash::values[];
-const char* const Singleton_InitHash::keywords[];
 //________________________________________
 
 string* literal = 0;
--- ./src/lexfwd.h
+++ ./src/lexfwd.h	2004-03-16 15:27:23.000000000 +0100
@@ -15,6 +15,7 @@
 #define LEXFWD_H
 
 #include <string>
+using namespace std;
 
 struct TextPos; // from error.h
 
--- ./src/parse.y
+++ ./src/parse.y	2004-03-16 16:50:25.000000000 +0100
@@ -60,8 +60,8 @@
 #include <cstdio>
 #include <iostream>
 
-#define YYSTYPE YYSTYPE_DUMMY
-#define yylval yylval_DUMMY
+//#define YYSTYPE YYSTYPE_DUMMY
+//#define yylval yylval_DUMMY
 
 #include "error.h"
 #include "lexqueue.h"
@@ -203,7 +203,7 @@
 %token<t> DEFINITIONS DIV DO DOM ELEMS ELSE ELSEIF END ERROR ERRS EXIT
 %token<t> EXPORTS EXT FALSE FLOOR FOR FROM FUNCTIONS HD IF IMPORTS IN
 %token<t> INDS INIT INSTANTIATION INV LEN LET MERGE MK_ MOD MODULE NIL
-%token<t> NOT OF OPERATIONS OTHERS PARAMETERS POST PRE RD REM RETURN
+%token<t> NOT OPERATIONS OTHERS PARAMETERS POST PRE RD REM RETURN
 %token<t> REVERSE RNG SKIP ST STATE THEN TIXE TOKEN TL TO TRAP TRUE
 %token<t> TYPES UNDEFINED USING VALUES WHILE WR
 
@@ -282,8 +282,8 @@
 %left LEQ '<' GEQ '>' '=' NEQ SUBSET PSUBSET IN_SET NOT_IN_SET
 
 // evaluators:
-%left '+', '-', UNION, MERGE, '\\' MUNION DAGGER '^'
-%left '*', '/', INTER REM MOD DIV
+%left '+' '-' UNION MERGE '\\' MUNION DAGGER '^'
+%left '*' '/' INTER REM MOD DIV
 %left INVERSE
 %left RESTRICT_DOM_TO RESTRICT_RNG_TO RESTRICT_DOM_BY RESTRICT_RNG_BY
 %left UNARY_PLUS UNARY_MINUS ABS FLOOR CARD POWER DINTER DUNION DOM RNG UNARY_MERGE LEN ELEMS HD TL CONC INDS
--- ./src/partfwd.h
+++ ./src/partfwd.h	2004-03-16 15:27:07.000000000 +0100
@@ -20,6 +20,7 @@
 #define PARTFWD_H
 
 #include <map>
+using namespace std;
 
 #include "smartptr.h"
 #include "treefwd.h"
--- ./src/partition.cc
+++ ./src/partition.cc	2004-03-16 15:45:31.000000000 +0100
@@ -15,6 +15,7 @@
 #include <iostream>
 #include <fstream>
 #include <memory>
+using namespace std;
 
 inline ostream& generatedBy(ostream& s);
 #include "cmdopt.h"
--- ./src/partition.h
+++ ./src/partition.h	2004-03-16 15:47:00.000000000 +0100
@@ -34,11 +34,11 @@
 class Part::Partition : public SmartPtrBase {
 public:
   Partition() { }
-  virtual inline ~Partition() throw() = 0;
-  virtual bool isConstTrue() const throw() = 0;
-  virtual bool isConstFalse() const throw() = 0;
+  virtual inline ~Partition() = 0;
+  virtual bool isConstTrue() const = 0;
+  virtual bool isConstFalse() const = 0;
   // nr of possible permutations for this node (and the nodes it contains)
-  virtual const BigInt& combinations() const throw() = 0;
+  virtual const BigInt& combinations() const = 0;
   /* create expr. corresponding to particular permutation of
      sub-partitions. arg must not be out of range. */
   virtual Tree::Expr* partition(const BigInt& x) const = 0;
@@ -55,7 +55,7 @@
     Dassert(false); abort(); // ditto?
   }
 };
-Part::Partition::~Partition() throw() { }
+Part::Partition::~Partition() /*throw()*/ { }
 
 inline ostream& operator<<(ostream& s, const Part::Partition& t) {
   return t.put(s);
--- ./src/partvirt.cc
+++ ./src/partvirt.cc	2004-03-16 16:27:42.000000000 +0100
@@ -401,10 +401,10 @@
 //______________________________________________________________________
 
 Part::Partition* Tree::BoolExpr::partTrue() {
-  return value() ? &Part::constTrue : &Part::constFalse;
+  if (value()) return &Part::constTrue; else return &Part::constFalse;
 }
 Part::Partition* Tree::BoolExpr::partFalse() {
-  return !value() ? &Part::constTrue : &Part::constFalse;
+  if (!value()) return &Part::constTrue; else return &Part::constFalse;
 }
 Part::Partition* Tree::BoolExpr::partDef() {
   return shouldBeInt(this);
--- ./src/scope.cc
+++ ./src/scope.cc	2004-03-16 16:28:02.000000000 +0100
@@ -115,7 +115,7 @@
    just the new value is def'd, return that. If both new and old are
    def'd, return old. */
 VarDef* Scope::lookupVariable(const Lex::IdToken& id, bool isOld,
-                              unsigned scopeSkip = 0) {
+                              unsigned scopeSkip) {
   // scopeDepth() of required var must be less or equal maxDepth
   size_t maxDepth = level() - scopeSkip;
 
--- ./src/scope.h
+++ ./src/scope.h	2004-03-16 15:42:49.000000000 +0100
@@ -41,6 +41,8 @@
 #include "type.h"
 //______________________________________________________________________
 
+class VarDef;
+
 class Scope {
 public:
   // each open() must be matched by a close()
@@ -79,6 +81,7 @@
   static void putScopeList(ostream& s, char* scopeName, list<VarDef*>& l);
 # endif
 
+  friend class VarDef;
   struct ScopeSingleton : public DebugSingleton {
     ScopeSingleton() { }
     ~ScopeSingleton();
--- ./src/tree.h
+++ ./src/tree.h	2004-03-16 15:44:23.000000000 +0100
@@ -114,13 +114,13 @@
   /* no ctor of a class derived from N should throw any exception other
      than bad_alloc. dtors should not throw any exceptions. */
   N() throw(std::bad_alloc) { }
-  inline virtual ~N() throw() = 0;
+  inline virtual ~N() /*throw()*/ = 0;
   virtual ostream& put(ostream& s) const = 0;
 private:
   N(N&) { Dassert(false); abort(); } // need deep copy
   void operator=(const N&) { Dassert(false); abort(); } // need deep copy
 };
-N::~N() throw() { }
+N::~N() /*throw()*/ { }
 
 inline ostream& operator<<(ostream& s, const N& t) { return t.put(s); }
 //______________________________________________________________________
@@ -2160,7 +2160,7 @@
 
 // inline functions which cannot be in the class definitions above
 
-TypeDefinition::TypeDefinition(IdToken* id, N* tf, Invariant* i = 0)
+TypeDefinition::TypeDefinition(IdToken* id, N* tf, Invariant* i)
     : identifierVal(id), typeOrField(tf), invariantVal(i) {
   Dassert(id != 0 && tf != 0);
   Dassert(id->token() == IDENTIFIER); // not a keyword!
