+ key = MSymbol.nil;
+ val = null;
+ }
+
+ public MPlist (FileStream stream)
+ {
+ MStreamReader reader = new MStreamReader (stream);
+ bool result = reader.ReadElement (out key, out val);
+
+ if (result)
+ next = new MPlist (reader);
+ }
+
+ public MPlist (FileStream stream, int count)
+ {
+ MStreamReader reader = new MStreamReader (stream);
+ bool result = reader.ReadElement (out key, out val);
+
+ if (result && --count > 0)
+ next = new MPlist (reader, count);
+ else
+ next = new MPlist ();
+ }
+
+ public MPlist (FileStream stream, MSymbol stop)
+ {
+ MStreamReader reader = new MStreamReader (stream);
+ bool result;
+
+ key = MSymbol.nil;
+ val = null;
+ while (true)
+ {
+ MSymbol this_key;
+ object this_val;
+
+ result = reader.ReadElement (out this_key, out this_val);
+ if (! result)
+ return;
+ if (this_key == MSymbol.plist)
+ {
+ MPlist plist = (MPlist) this_val;
+
+ if (plist.IsSymbol && plist.Symbol == stop)
+ return;
+ }
+ key = this_key;
+ val = this_val;
+ next = new MPlist (reader, stop);
+ }
+ }
+
+ public MPlist (FileStream stream, MSymbol target, MSymbol stop)
+ {
+ MStreamReader reader = new MStreamReader (stream);
+ bool result;
+
+ key = MSymbol.nil;
+ val = null;
+ while (true)
+ {
+ MSymbol this_key;
+ object this_val;
+
+ result = reader.ReadElement (out this_key, out this_val);
+ if (! result)
+ return;
+ if (this_key == MSymbol.plist)
+ {
+ MPlist plist = (MPlist) this_val;
+
+ if (plist.IsSymbol)
+ {
+ if (plist.Symbol == stop)
+ return;
+ if (plist.Symbol == target)
+ {
+ key = target;
+ val = this_val;
+ next = new MPlist ();
+ return;
+ }
+ }
+ }
+ }