Example #1
0
 static GSymbol()
 {
     Pool  = new SymbolPool(0, 0);
     Empty = Pool.Get("");
     Debug.Assert(Empty.Id == 0 && Empty.Name == "");
     Debug.Assert(((Symbol)Empty).Pool == Pool);
 }
Example #2
0
 /// <summary>For use by a derived class to produce a statically-typed
 /// enumeration in a private pool. See the example under SymbolPool
 /// (of SymbolEnum)</summary>
 /// <param name="prototype">A strictly temporary Symbol that is used
 /// to initialize this object. The derived class should discard the
 /// prototype after calling this constructor.</param>
 protected Symbol(Symbol prototype)
 {
     _id   = prototype._id;
     _name = prototype._name;
     _pool = prototype._pool;
 }
Example #3
0
 /// <summary>For internal use only. Call GSymbol.Get() instead!</summary>
 internal Symbol(int id, string name, SymbolPool pool)
 {
     _id = id; _name = name; _pool = pool;
 }