From: handa Date: Mon, 14 Aug 2006 13:12:04 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51dc47331efdef005025263ef3cdcede82dbba7e;p=m17n%2Fm17n-lib-cs.git *** empty log message *** --- diff --git a/M17N.cs b/M17N.cs new file mode 100644 index 0000000..3663570 --- /dev/null +++ b/M17N.cs @@ -0,0 +1,27 @@ +using System; +using M17N.Core; + +public class Test +{ + public static void Main() + { + MSymbol sym1, sym2; + + sym1 = new MSymbol ("abc"); + Console.WriteLine (sym1.ToString ()); + sym2 = new MSymbol ("abc"); + Console.WriteLine (sym2.ToString ()); + Console.WriteLine (sym1 == sym2 ? "OK" : "NO"); + sym1.put (MSymbol.nil, MSymbol.t); + + MPlist p = new MPlist (); + + p.put (MSymbol.t, sym1); + p.push (MSymbol.t, sym2); + + MPlist pp = new MPlist (); + pp.put (MSymbol.t, p); + Console.WriteLine (pp.ToString ()); + Console.WriteLine (p.get (MSymbol.t)); + } +} diff --git a/MSymbol.cs b/MSymbol.cs index 14e3e3b..06e5370 100644 --- a/MSymbol.cs +++ b/MSymbol.cs @@ -1,7 +1,7 @@ using System; -using M17N; +using M17N.Core; -namespace M17N +namespace M17N.Core { public class MPlist { @@ -183,79 +183,4 @@ namespace M17N return data.plist.put (key, val); } } - - public class MTextProperty - { - } - - public enum MTextFormat - { - MTEXT_FORMAT_US_ASCII, - MTEXT_FORMAT_UTF_8, - MTEXT_FORMAT_UTF_16BE, - MTEXT_FORMAT_UTF_16LE, - MTEXT_FORMAT_UTF_32BE, - MTEXT_FORMAT_UTF_32LE, - } - - public class MText - { - private class MTextPlist : MPlist - { - public class MInterval - { - public MPlist stack; - public int nprops; - public int start, end; - public MInterval prev, next; - } - - MInterval head, tail; - - public MTextPlist (MText mt) - { - head = tail = new MInterval (); - head.start = 0; - head.end = mt.nchars; - } - } - - private string str; - private int nchars; - private int nunits; - private int cache_pos; - private int cache_idx; - private MTextPlist plist; - - public MText (byte str, MTextFormat format) - { - - } - } - - - public class Test - { - public static void Main() - { - MSymbol sym1, sym2; - - sym1 = new MSymbol ("abc"); - Console.WriteLine (sym1.ToString ()); - sym2 = new MSymbol ("abc"); - Console.WriteLine (sym2.ToString ()); - Console.WriteLine (sym1 == sym2 ? "OK" : "NO"); - sym1.put (MSymbol.nil, MSymbol.t); - - MPlist p = new MPlist (); - - p.put (MSymbol.t, sym1); - p.push (MSymbol.t, sym2); - - MPlist pp = new MPlist (); - pp.put (MSymbol.t, p); - Console.WriteLine (pp.ToString ()); - Console.WriteLine (p.get (MSymbol.t)); - } - } } diff --git a/MText.cs b/MText.cs new file mode 100644 index 0000000..090d58b --- /dev/null +++ b/MText.cs @@ -0,0 +1,54 @@ +using System; +using M17N.Core; + +namespace M17N.Core +{ + public enum MTextFormat + { + MTEXT_FORMAT_US_ASCII, + MTEXT_FORMAT_UTF_8, + MTEXT_FORMAT_UTF_16BE, + MTEXT_FORMAT_UTF_16LE, + MTEXT_FORMAT_UTF_32BE, + MTEXT_FORMAT_UTF_32LE, + } + + public class MText + { + private class MTextPlist : MPlist + { + public class MInterval + { + MPlist stack; + int nprops; + public int start, end; + public MInterval prev, next; + } + + MInterval head, tail; + + public MTextPlist (MText mt) + { + head = tail = new MInterval (); + head.start = 0; + head.end = mt.nchars; + } + } + + private string str; + private int nchars; + private int nunits; + private int cache_pos; + private int cache_idx; + private MTextPlist plist; + + public MText (byte str, MTextFormat format) + { + + } + } + + public class MTextProperty + { + } +} diff --git a/Makefile b/Makefile index 3454d54..77316fa 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,12 @@ -all: MSymbol.exe +CORE_SRC = MSymbol.cs MText.cs +all: M17N.exe -%.exe: %.cs - mcs $< +M17N.exe: M17N.cs M17NCore.dll + mcs /r:M17NCore M17N.cs + +M17NCore.dll: ${CORE_SRC} + mcs /out:$@ /t:library ${CORE_SRC} + +clean: + rm -f *.dll *.exe