*** 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 = new MSymbol ("sym1");
12     MSymbol sym2 = new MSymbol ("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         MStreamReader reader = new MStreamReader (stream);
30         Console.WriteLine (new MPlist (reader));
31       }
32
33     plist = new MPlist ();
34     plist.Push (new MSymbol ("abc"));
35     plist.Push (new MText ("abc"));
36     plist.Push (new MPlist ());
37     plist.Push (123);
38     plist.Push (4.5);
39     Console.WriteLine (plist);
40
41     MSymbol tmp = MSymbol.nil;
42     if (tmp == null)
43       Console.WriteLine ("null");
44   }
45 }