Beispiel #1
0
		static object UnicodeCategorySerialise(object o,Serialiser s)
		{
			if (s.Encode) 
			{
				s._Write((int)o);
				return null;
			}
			return (UnicodeCategory)s._Read();
		}
Beispiel #2
0
 private static object IntSerialise(object o, Serialiser s)
 {
     if (!s.Encode)
     {
         return((object)s._Read());
     }
     s._Write((int)o);
     return((object)null);
 }
Beispiel #3
0
 private static object UnicodeCategorySerialise(object o, Serialiser s)
 {
     if (!s.Encode)
     {
         return((object)(UnicodeCategory)s._Read());
     }
     s._Write((int)o);
     return((object)null);
 }
Beispiel #4
0
 private static object SymtypeSerialise(object o, Serialiser s)
 {
     if (!s.Encode)
     {
         return((object)(CSymbol.SymType)s._Read());
     }
     s._Write((int)o);
     return((object)null);
 }
Beispiel #5
0
		static object IntSerialise(object o,Serialiser s)
		{
			if (s.Encode) 
			{
				s._Write((int)o);
				return null;
			}
			return s._Read();
		}
Beispiel #6
0
		static object SymtypeSerialise(object o,Serialiser s)
		{
			if (s.Encode) 
			{
				s._Write((int)o);
				return null;
			}
			return (CSymbol.SymType)s._Read();
		}
Beispiel #7
0
 private static object BoolSerialise(object o, Serialiser s)
 {
     if (!s.Encode)
     {
         return((object)(s._Read() != 0));
     }
     s._Write(!(bool)o ? 0 : 1);
     return((object)null);
 }
Beispiel #8
0
		static object BoolSerialise(object o,Serialiser s)
		{
			if (s.Encode) 
			{
				s._Write(((bool)o)?1:0);
				return null;
			}
			int v = s._Read();
			return v!=0;
		}
Beispiel #9
0
		public void Emit(TextWriter m_outFile)
		{
			Serialiser b = new Serialiser(m_outFile);
			b.VersionCheck();
			Console.WriteLine("Serialising the parser");
			b.Serialise(m_startSymbol);
			b.Serialise(m_accept);
			b.Serialise(m_states);
			b.Serialise(literals);
			b.Serialise(symbolInfo);
			b.Serialise(m_concrete);
			m_outFile.WriteLine("0};");
		}
Beispiel #10
0
 public new static object Serialise(object o, Serialiser s)
 {
     if (s == null)
     {
         return((object)new ParserSimpleAction());
     }
     if (!s.Encode)
     {
         return(ParserAction.Serialise(o, s));
     }
     ParserAction.Serialise(o, s);
     return((object)null);
 }
Beispiel #11
0
		public void EmitDfa(TextWriter outFile)
		{
			Console.WriteLine("Serializing the lexer");
			Serialiser f = new Serialiser(outFile);
			f.Serialise(m_encoding);
			f.Serialise(toupper);
			f.Serialise(cats);
			f.Serialise(m_gencat);
			f.Serialise(usingEOF);
			f.Serialise(starts);
			f.Serialise(tokens);
			outFile.WriteLine("0};");
		}
Beispiel #12
0
		public static object Serialise(object o,Serialiser s)
		{
			if (s==null)
				return new TokClassDef();
			TokClassDef t = (TokClassDef)o;
			if (s.Encode)
			{
				s.Serialise(t.m_name);
				return null;
			}
			t.m_name = (string)s.Deserialise();
			return t;
		}
Beispiel #13
0
        public void Emit(TextWriter m_outFile)
        {
            Serialiser serialiser = new Serialiser(m_outFile);

            serialiser.VersionCheck();
            Console.WriteLine("Serialising the parser");
            serialiser.Serialise((object)this.m_startSymbol);
            serialiser.Serialise((object)this.m_accept);
            serialiser.Serialise((object)this.m_states);
            serialiser.Serialise((object)this.literals);
            serialiser.Serialise((object)this.symbolInfo);
            serialiser.Serialise((object)this.m_concrete);
            m_outFile.WriteLine("0};");
        }
Beispiel #14
0
		// Deserializing
		public void GetDfa()
		{
			if (tokens.Count>0)
				return;
			Serialiser f = new Serialiser(arr);
			m_encoding = (Encoding)f.Deserialise();
			toupper = (bool)f.Deserialise();
			cats = (Hashtable)f.Deserialise();
			m_gencat = (UnicodeCategory)f.Deserialise();
			usingEOF = (bool)f.Deserialise();
			starts = (Hashtable)f.Deserialise();
			Dfa.SetTokens(this,starts);
			tokens = (Hashtable)f.Deserialise();
		}
Beispiel #15
0
        public void GetParser(Lexer m_lexer)
        {
            Serialiser serialiser = new Serialiser(this.arr);

            serialiser.VersionCheck();
            this.m_startSymbol      = (CSymbol)serialiser.Deserialise();
            this.m_startSymbol.kids = new ObjectList();
            this.m_accept           = (ParseState)serialiser.Deserialise();
            this.m_states           = (Hashtable)serialiser.Deserialise();
            this.literals           = (Hashtable)serialiser.Deserialise();
            this.symbolInfo         = (Hashtable)serialiser.Deserialise();
            this.m_concrete         = (bool)serialiser.Deserialise();
            this.GetEOF(m_lexer);
        }
Beispiel #16
0
        public void EmitDfa(TextWriter outFile)
        {
            Console.WriteLine("Serializing the lexer");
            Serialiser f = new Serialiser(outFile);

            f.Serialise(m_encoding);
            f.Serialise(toupper);
            f.Serialise(cats);
            f.Serialise(m_gencat);
            f.Serialise(usingEOF);
            f.Serialise(starts);
            f.Serialise(tokens);
            outFile.WriteLine("0};");
        }
Beispiel #17
0
        public static object Serialise(object o, Serialiser s)
        {
            if (s == null)
            {
                return(new TokClassDef());
            }
            TokClassDef t = (TokClassDef)o;

            if (s.Encode)
            {
                s.Serialise(t.m_name);
                return(null);
            }
            t.m_name = (string)s.Deserialise();
            return(t);
        }
Beispiel #18
0
        public static object Serialise(object o, Serialiser s)
        {
            if (s == null)
            {
                return((object)new Production());
            }
            Production production = (Production)o;

            if (s.Encode)
            {
                s.Serialise((object)production.m_pno);
                return((object)null);
            }
            production.m_pno = (int)s.Deserialise();
            return((object)production);
        }
Beispiel #19
0
		static object CharSerialise(object o,Serialiser s)
		{
			Encoding e = new UnicodeEncoding();
			if (s.Encode) 
			{
				byte[] b = e.GetBytes(new string((char)o,1));
				s._Write((int)b[0]);
				s._Write((int)b[1]);
				return null;
			}
			byte[] bb = new byte[2];
			bb[0] = (byte)s._Read();
			bb[1] = (byte)s._Read();
			string r = e.GetString(bb,0,2);
			return r[0];
		}
Beispiel #20
0
        public new static object Serialise(object o, Serialiser s)
        {
            ParserAction parserAction = (ParserAction)o;

            if (s.Encode)
            {
                CSymbol.Serialise((object)parserAction, s);
                s.Serialise((object)parserAction.m_sym);
                s.Serialise((object)parserAction.m_len);
                return((object)null);
            }
            CSymbol.Serialise((object)parserAction, s);
            parserAction.m_sym = (CSymbol)s.Deserialise();
            parserAction.m_len = (int)s.Deserialise();
            return((object)parserAction);
        }
        public void EmitDfa(TextWriter outFile)
        {
            Console.WriteLine("Serializing the lexer");
            Serialiser serialiser = new Serialiser(outFile);

            serialiser.VersionCheck();
            serialiser.Serialise((object)this.m_encoding);
            serialiser.Serialise((object)this.toupper);
            serialiser.Serialise((object)this.cats);
            serialiser.Serialise((object)this.m_gencat);
            serialiser.Serialise((object)this.usingEOF);
            serialiser.Serialise((object)this.starts);
            serialiser.Serialise((object)this.tokens);
            serialiser.Serialise((object)this.reswds);
            outFile.WriteLine("0};");
        }
Beispiel #22
0
        // Deserializing
        public void GetDfa()
        {
            if (tokens.Count > 0)
            {
                return;
            }
            Serialiser f = new Serialiser(arr);

            m_encoding = (Encoding)f.Deserialise();
            toupper    = (bool)f.Deserialise();
            cats       = (Hashtable)f.Deserialise();
            m_gencat   = (UnicodeCategory)f.Deserialise();
            usingEOF   = (bool)f.Deserialise();
            starts     = (Hashtable)f.Deserialise();
            Dfa.SetTokens(this, starts);
            tokens = (Hashtable)f.Deserialise();
        }
Beispiel #23
0
 public static object Serialise(object o, Serialiser s)
 {
     if (s == null)
     {
         return((object)new Dfa.Action());
     }
     Dfa.Action action = (Dfa.Action)o;
     if (s.Encode)
     {
         s.Serialise((object)action.a_act);
         s.Serialise((object)action.a_next);
         return((object)null);
     }
     action.a_act  = (int)s.Deserialise();
     action.a_next = (Dfa.Action)s.Deserialise();
     return((object)action);
 }
Beispiel #24
0
 /// <exclude/>
 public static object Serialise(object o,Serialiser s)
 {
     if (s==null)
         return new CSymbol();
     CSymbol c = (CSymbol)o;
     if (s.Encode)
     {
         s.Serialise(c.yytext);
         s.Serialise(c.m_yynum);
         s.Serialise((int)c.m_symtype);
         return null;
     }
     c.yytext = (string)s.Deserialise();
     c.m_yynum = (int)s.Deserialise();
     c.m_symtype = (SymType)s.Deserialise();
     return c;
 }
Beispiel #25
0
		static object EncodingSerialise(object o,Serialiser s)
		{
			if (s.Encode)
			{
				Encoding e = (Encoding)o;
				s.Serialise(e.WebName);
				return null;
			}
			switch((string)s.Deserialise())
			{
				case "us-ascii": return Encoding.ASCII;
				case "utf-16": return Encoding.Unicode;
				case "utf-7": return Encoding.UTF7;
				case "utf-8": return Encoding.UTF8;
			}
			throw new Exception("Unknown encoding");
		}
Beispiel #26
0
            public static object Serialise(object o, Serialiser s)
            {
                if (s == null)
                {
                    return(new Action());
                }
                Action a = (Action)o;

                if (s.Encode)
                {
                    s.Serialise(a.a_act);
                    s.Serialise(a.a_next);
                    return(null);
                }
                a.a_act  = (int)s.Deserialise();
                a.a_next = (Action)s.Deserialise();
                return(a);
            }
Beispiel #27
0
        private static object CharSerialise(object o, Serialiser s)
        {
            Encoding encoding = (Encoding) new UnicodeEncoding();

            if (s.Encode)
            {
                byte[] bytes = encoding.GetBytes(new string((char)o, 1));
                s._Write((int)bytes[0]);
                s._Write((int)bytes[1]);
                return((object)null);
            }
            byte[] bytes1 = new byte[2]
            {
                (byte)s._Read(),
                (byte)s._Read()
            };
            return((object)encoding.GetString(bytes1, 0, 2)[0]);
        }
Beispiel #28
0
        public static object Serialise(object o, Serialiser s)
        {
            if (s == null)
            {
                return(new ResWds());
            }
            ResWds r = (ResWds)o;

            if (s.Encode)
            {
                s.Serialise(r.m_upper);
                s.Serialise(r.m_wds);
                return(null);
            }
            r.m_upper = (bool)s.Deserialise();
            r.m_wds   = (Hashtable)s.Deserialise();
            return(r);
        }
        public void GetDfa()
        {
            if (this.tokens.Count > 0)
            {
                return;
            }
            Serialiser serialiser = new Serialiser(this.arr);

            serialiser.VersionCheck();
            this.m_encoding = (Encoding)serialiser.Deserialise();
            this.toupper    = (bool)serialiser.Deserialise();
            this.cats       = (Hashtable)serialiser.Deserialise();
            this.m_gencat   = (UnicodeCategory)serialiser.Deserialise();
            this.usingEOF   = (bool)serialiser.Deserialise();
            this.starts     = (Hashtable)serialiser.Deserialise();
            Dfa.SetTokens(this, this.starts);
            this.tokens = (Hashtable)serialiser.Deserialise();
            this.reswds = (Hashtable)serialiser.Deserialise();
        }
Beispiel #30
0
        public static object Serialise(object o, Serialiser s)
        {
            if (s == null)
            {
                return((object)new ParsingInfo());
            }
            ParsingInfo parsingInfo = (ParsingInfo)o;

            if (s.Encode)
            {
                s.Serialise((object)parsingInfo.m_name);
                s.Serialise((object)parsingInfo.m_yynum);
                s.Serialise((object)parsingInfo.m_parsetable);
                return((object)null);
            }
            parsingInfo.m_name       = (string)s.Deserialise();
            parsingInfo.m_yynum      = (int)s.Deserialise();
            parsingInfo.m_parsetable = (Hashtable)s.Deserialise();
            return((object)parsingInfo);
        }
Beispiel #31
0
        public static object Serialise(object o, Serialiser s)
        {
            if (s == null)
            {
                return((object)new CSymbol());
            }
            CSymbol csymbol = (CSymbol)o;

            if (s.Encode)
            {
                s.Serialise((object)csymbol.yytext);
                s.Serialise((object)csymbol.m_yynum);
                s.Serialise((object)(int)csymbol.m_symtype);
                return((object)null);
            }
            csymbol.yytext    = (string)s.Deserialise();
            csymbol.m_yynum   = (int)s.Deserialise();
            csymbol.m_symtype = (CSymbol.SymType)s.Deserialise();
            return((object)csymbol);
        }
Beispiel #32
0
        public static object Serialise(object o, Serialiser s)
        {
            if (s == null)
            {
                return((object)new ParseState());
            }
            ParseState parseState = (ParseState)o;

            if (s.Encode)
            {
                s.Serialise((object)parseState.m_state);
                s.Serialise((object)parseState.m_accessingSymbol);
                s.Serialise((object)parseState.m_changed);
                return((object)true);
            }
            parseState.m_state           = (int)s.Deserialise();
            parseState.m_accessingSymbol = (CSymbol)s.Deserialise();
            parseState.m_changed         = (bool)s.Deserialise();
            return((object)parseState);
        }
Beispiel #33
0
		static object StringSerialise(object o,Serialiser s)
		{
			if (s==null)
				return "";
			Encoding e = new UnicodeEncoding();
			if (s.Encode) 
			{
				byte[] b = e.GetBytes((string)o);
				s._Write(b.Length);
				for (int j=0;j<b.Length;j++)
					s._Write((int)b[j]);
				return null;
			}
			int ln = s._Read();
			byte[] bb = new byte[ln];
			for (int k=0;k<ln;k++)
				bb[k] = (byte)s._Read();
			string r = e.GetString(bb,0,ln);
			return r;
		}
Beispiel #34
0
        public new static object Serialise(object o, Serialiser s)
        {
            if (s == null)
            {
                return((object)new ParserReduce());
            }
            ParserReduce parserReduce = (ParserReduce)o;

            if (s.Encode)
            {
                ParserEntry.Serialise((object)parserReduce, s);
                s.Serialise((object)parserReduce.m_depth);
                s.Serialise((object)parserReduce.m_prod);
                return((object)null);
            }
            ParserEntry.Serialise((object)parserReduce, s);
            parserReduce.m_depth = (int)s.Deserialise();
            parserReduce.m_prod  = (Production)s.Deserialise();
            return((object)parserReduce);
        }
Beispiel #35
0
        public static object Serialise(object o, Serialiser s)
        {
            if (s == null)
            {
                return((object)new Charset());
            }
            Charset charset = (Charset)o;

            if (s.Encode)
            {
                s.Serialise((object)(int)charset.m_cat);
                s.Serialise((object)charset.m_generic);
                s.Serialise((object)charset.m_chars);
                return((object)null);
            }
            charset.m_cat     = (UnicodeCategory)s.Deserialise();
            charset.m_generic = (char)s.Deserialise();
            charset.m_chars   = (Hashtable)s.Deserialise();
            return((object)charset);
        }
Beispiel #36
0
 /// <exclude/>
 public static object Serialise(object o,Serialiser s)
 {
     if (s==null)
         return new Dfa();
     Dfa d = (Dfa)o;
     if (s.Encode)
     {
         s.Serialise(d.m_state);
         s.Serialise(d.m_map);
         s.Serialise(d.m_actions);
         s.Serialise(d.m_tokClass);
         s.Serialise(d.m_reswds);
         return null;
     }
     d.m_state = (int)s.Deserialise();
     d.m_map = (Hashtable)s.Deserialise();
     d.m_actions = (Action)s.Deserialise();
     d.m_tokClass = (string)s.Deserialise();
     d.m_reswds = (int)s.Deserialise();
     return d;
 }
Beispiel #37
0
				{
					v = v*10 + (c-'0');
					continue;
				}
				throw new Exception("illegal character");
			}
			throw new Exception("bad line");
		}
		public static void Main(string[] args)
		{
			TextWriter x = new StreamWriter("out.txt");
			Hashtable t = new Hashtable();
			t["John"] = 12;
			t["Mary"] = 34;
			Serialiser sr = new Serialiser(x);
			Console.WriteLine("Encoding");
			sr.Serialise(t);
			x.Close();
			ArrayList a = new ArrayList();
			TextReader y = new StreamReader("out.txt");
			GetLine(y);
			while (!EOF)
				a.Add(GetInt(y));
			y.Close();
Beispiel #38
0
					obs[u] = r;
					r = os(r,this); // really deserialise it
					obs[u] = r;	// we need to store it again for strings
					return r;
				}
				return os(null,this); 
			}
			else
				throw new Exception("unknown type "+t);
		}
Beispiel #39
0
/*	public class Test
	{
		static string curline = "";
		static int pos = 0;
		static bool EOF = false;
		static void GetLine(TextReader f)
		{
			curline = f.ReadLine();
			pos = 0;
			if (curline == null)
				EOF = true;
		}
		static int GetInt(TextReader f)
		{
			int v = 0;
			bool s = false;
Beispiel #40
0
			{
				char c = curline[pos++];
				if (c==' ')
					continue;
				if (c=='-')
				{
					s = true;
					continue;
				}
				if (c==',')
				{
					if (s)
						v = -v;
					if (pos==curline.Length)
						GetLine(f);
					return v;
				}
Beispiel #41
0
		public static object Serialise(object o,Serialiser s)
		{
			if (s==null)
				return new Production();
			Production p = (Production)o;
			if (s.Encode) 
			{
				s.Serialise(p.m_pno);
				return null;
			}
			p.m_pno = (int)s.Deserialise();
			return p;
		}
Beispiel #42
0
		public new static object Serialise(object o,Serialiser s)
		{
			ParserAction p = (ParserAction)o;
			if (s.Encode)
			{
				CSymbol.Serialise(p,s);
				s.Serialise(p.m_sym);
				s.Serialise(p.m_len);
				return null;
			}
			CSymbol.Serialise(p,s);
			p.m_sym = (CSymbol)s.Deserialise();
			p.m_len = (int)s.Deserialise();
			return p;
		}
Beispiel #43
0
		public new static object Serialise(object o,Serialiser s)
		{
			if (s==null)
				return new ParserSimpleAction();
			if (s.Encode)
			{
				ParserAction.Serialise(o,s);
				return null;
			}
			return ParserAction.Serialise(o,s);
		}
Beispiel #44
0
		public new static object Serialise(object o,Serialiser s)
		{
			if (s==null)
				return new ParserShift();
			ParserShift p = (ParserShift)o;
			if (s.Encode) 
			{
				ParserEntry.Serialise(p,s);
				s.Serialise(p.m_next);
				return null;
			}
			ParserEntry.Serialise(p,s);
			p.m_next = (ParseState)s.Deserialise();
			return p;
		}
Beispiel #45
0
		public static object Serialise(object o,Serialiser s)
		{
			if (s==null)
				return new ParsingInfo();
			ParsingInfo p = (ParsingInfo)o;
			if (s.Encode) 
			{
				s.Serialise(p.m_name);
				s.Serialise(p.m_yynum);
				s.Serialise(p.m_parsetable);
				return null;
			}
			p.m_name = (string)s.Deserialise();
			p.m_yynum = (int)s.Deserialise();
			p.m_parsetable = (Hashtable)s.Deserialise();
			return p;
		}
Beispiel #46
0
 /// <exclude/>
 public static object Serialise(object o,Serialiser s)
 {
     if (s==null)
         return new Action();
     Action a = (Action)o;
     if (s.Encode)
     {
         s.Serialise(a.a_act);
         s.Serialise(a.a_next);
         return null;
     }
     a.a_act = (int)s.Deserialise();
     a.a_next = (Action)s.Deserialise();
     return a;
 }
Beispiel #47
0
 /// <exclude/>
 public static object Serialise(object o,Serialiser s)
 {
     if (s==null)
         return new ResWds();
     ResWds r = (ResWds)o;
     if (s.Encode)
     {
         s.Serialise(r.m_upper);
         s.Serialise(r.m_wds);
         return null;
     }
     r.m_upper = (bool)s.Deserialise();
     r.m_wds = (Hashtable)s.Deserialise();
     return r;
 }
Beispiel #48
0
 /// <exclude/>
 public static new object Serialise(object o,Serialiser s)
 {
     if (s==null)
         return new Literal();
     return CSymbol.Serialise(o,s);
 }
Beispiel #49
0
		public new static object Serialise(object o,Serialiser s)
		{
			if (s==null)
				return new EOF();
			return CSymbol.Serialise(o,s);
		}
Beispiel #50
0
				Console.WriteLine((int)a[k]); 
			int[] b = new int[a.Count];
			for (int k=0;k<a.Count;k++)
				b[k] = (int)a[k];
			Serialiser dr = new Serialiser(b);
			Hashtable h = (Hashtable)dr.Deserialise();
			foreach (DictionaryEntry d in h)
				Console.WriteLine((string)d.Key + "->" + (int)d.Value);
		}
Beispiel #51
0
		public new static object Serialise(object o,Serialiser s)
		{
			if (s==null)
				return new ParserOldAction();
			ParserOldAction p = (ParserOldAction)o;
			if (s.Encode) 
			{
				ParserAction.Serialise(p,s);
				s.Serialise(p.m_action);
				return null;
			}
			ParserAction.Serialise(p,s);
			p.m_action = (int)s.Deserialise();
			return p;
		}
Beispiel #52
0
}
Beispiel #53
0
		public static object Serialise(object o, Serialiser s)
		{
			ParserEntry p = (ParserEntry)o;
			if (s.Encode) 
			{
				s.Serialise(p.m_action);
				return null;
			}
			p.m_action = (ParserAction)s.Deserialise();
			return p;
		}
Beispiel #54
0

        
Beispiel #55
0
		public new static object Serialise(object o,Serialiser s)
		{
			if (s==null)
				return new ParserReduce();
			ParserReduce p = (ParserReduce)o;
			if (s.Encode) 
			{
				ParserEntry.Serialise(p,s);
				s.Serialise(p.m_depth);
				s.Serialise(p.m_prod);
				return null;
			}
			ParserEntry.Serialise(p,s);
			p.m_depth = (int)s.Deserialise();
			p.m_prod = (Production)s.Deserialise();
			return p;
		}
Beispiel #56
0

        
Beispiel #57
0
		public static object Serialise(object o, Serialiser s)
		{
			if (s==null)
				return new ParseState();
			ParseState p = (ParseState)o;
			if (s.Encode)
			{
				s.Serialise(p.m_state);
				s.Serialise(p.m_accessingSymbol);
				s.Serialise(p.m_changed);
				return true;
			}
			p.m_state = (int)s.Deserialise();
			p.m_accessingSymbol = (CSymbol)s.Deserialise();
			p.m_changed = (bool)s.Deserialise();
			return p;
		}
Beispiel #58
0

        
Beispiel #59
0
		public void GetParser(Lexer m_lexer)
		{
			Serialiser b = new Serialiser(arr);
			b.VersionCheck();
			m_startSymbol = (CSymbol)b.Deserialise();
			m_startSymbol.kids = new ObjectList(); // 4.2a
			m_accept = (ParseState)b.Deserialise();
			m_states = (Hashtable)b.Deserialise();
			literals = (Hashtable)b.Deserialise();
			symbolInfo = (Hashtable)b.Deserialise();
			m_concrete = (bool)b.Deserialise();
			GetEOF(m_lexer);
		}
 /// <exclude/>
 public static object Serialise(object o,Serialiser s)
 {
     if (s==null)
         return new Charset();
     Charset c = (Charset)o;
     if (s.Encode)
     {
         s.Serialise((int)c.m_cat);
         s.Serialise(c.m_generic);
         s.Serialise(c.m_chars);
         return null;
     }
     c.m_cat = (UnicodeCategory)s.Deserialise();
     c.m_generic = (char)s.Deserialise();
     c.m_chars = (Hashtable)s.Deserialise();
     return c;
 }