*** empty log message ***
[m17n/m17n-lib-cs.git] / plist.cs
1 using System;
2 using System.IO;
3 using System.Collections.Generic;
4 using M17N;
5 using M17N.Core;
6
7 public class Test
8 {
9   public static void Main()
10   {
11     MSymbol sym1 = MSymbol.Of ("sym1");
12     MSymbol sym2 = MSymbol.Of ("sym2");
13     MPlist plist = new MPlist ();
14     MText mt1 = new MText ("abc");
15     MText mt2 = new MText ("ABC");
16
17     plist.Put (sym1, mt1);
18     plist.Put (sym2, mt2);
19
20     Console.WriteLine (plist);
21     foreach (MPlist p in plist)
22       Console.WriteLine (p.Key + ":" + p.Val);
23     Console.WriteLine (plist.Clone ());
24
25     M17n.debug = true;
26
27     using (FileStream stream = File.OpenRead ("temp.plist"))
28       {
29         Console.WriteLine (new MPlist (stream));
30       }
31
32     plist = new MPlist ();
33     plist.Push (MSymbol.Of ("abc"));
34     plist.Push (new MText ("abc"));
35     plist.Push (new MPlist ());
36     plist.Push (123);
37     plist.Push (4.5);
38     Console.WriteLine (plist);
39     Console.WriteLine ("plist[3] = " + plist[3]);
40
41     MSymbol tmp = MSymbol.nil;
42     if (tmp == null)
43       Console.WriteLine ("null");
44   }
45 }