};
public Tag tag;
+ public NameTable name_table = new NameTable ();
private Loader loader;
private object ExtraInfo;
// Directory of the database file.
return loader (tag, ExtraInfo);
if (Info.Format == Mxml)
{
- XmlDocument doc = new XmlDocument ();
+ XmlDocument doc = new XmlDocument (name_table);
try {
- XmlReader reader = XmlReader.Create (FileInfo.FullName);
+ XmlTextReader reader
+ = new XmlTextReader (FileInfo.FullName, name_table);
doc.Load (reader);
LastLoaded = DateTime.Now;
} catch (Exception e) {
return null;
if (Info.Format == Mxml)
{
- XmlDocument doc = new XmlDocument ();
- XmlTextReader reader = new XmlTextReader (stream);
+ XmlDocument doc = new XmlDocument (name_table);
+ XmlTextReader reader = new XmlTextReader (stream, name_table);
reader.WhitespaceHandling = WhitespaceHandling.None;
try {
return null;
if (Info.Format == Mxml)
{
- XmlDocument doc = new XmlDocument ();
- XmlTextReader reader = new XmlTextReader (stream);
+ XmlDocument doc = new XmlDocument (name_table);
+ XmlTextReader reader = new XmlTextReader (stream, name_table);
reader.WhitespaceHandling = WhitespaceHandling.None;
try {
if (Info.Format != Mxml)
throw new Exception ("Not an XML format");
- XmlDocument doc = new XmlDocument ();
- XmlTextReader reader = new XmlTextReader (stream);
+ XmlDocument doc = new XmlDocument (name_table);
+ XmlTextReader reader = new XmlTextReader (stream, name_table);
int len = nodes.Length;
reader.WhitespaceHandling = WhitespaceHandling.None;
if (description == null)
description = "No description";
keys = new List<KeySeq> ();
+ Console.WriteLine ("cmd:" + p);
for (p = p.next; ! p.IsEmpty; p = p.next)
{
if (p.IsMText)
public Command (XmlNode node)
{
- name = node.Attributes["id"].Value;
+ name = node.Attributes[0].Value;
keys = new List<KeySeq> ();
for (node = node.FirstChild; node != null; node = node.NextSibling)
{
}
// Instance members
- internal Xex.Domain domain;
+ internal Xex.Domain domain = new Xex.Domain (im_domain, null);
private LoadStatus load_status = LoadStatus.None;
private MDatabase.Tag tag;
mdb = MDatabase.Find (tag);
if (mdb == null)
return false;
+ mdb.name_table = Xex.Symbol.Table;
try {
MSymbol format = mdb.Format;
private bool load_body ()
{
- domain = new Xex.Domain (im_domain, null);
mdb = MDatabase.Find (tag);
if (mdb == null)
return false;
+ mdb.name_table = Xex.Symbol.Table;
try {
object obj = mdb.Load ();
if (obj is MPlist)
Xex.Variable vari = get_global_var (name);
if (vari != null)
domain.Defvar (vari);
- else
- domain.Defvar (node_list[i]);
-
+ domain.Defvar (node_list[i]);
var_names[i] = name;
}
}
val = new MPlist (this);
key = MSymbol.plist;
}
- else if (c == '"' || c == '\\')
+ else if (c == '"')
{
MText mt;
ReadMText (out mt);
xex.exe: xex.cs XmlExpr.dll
$(RUNCS) -r:XmlExpr.dll $<
-%.exe: %.cs
+%.exe: %.cs ${DLL}
$(RUNCS) -r:M17N.dll -r:M17NCore $<
clean:
private static bool SubsetP (string[] r1, string[] r2)
{
+ if (r2 == null)
+ return true;
foreach (string s in r1)
if (! SubsetP (s, r2))
return false;
private static bool SubsetP (string str, string[] r)
{
+ if (r == null)
+ return true;
foreach (string s in r)
if (str == s)
return true;
private static bool SubsetP (Symbol[] r1, Symbol[] r2)
{
+ if (r2 == null)
+ return true;
foreach (Symbol n in r1)
if (! SubsetP (n, r2))
return false;
private static bool SubsetP (Symbol name, Symbol[] r)
{
+ if (r == null)
+ return true;
foreach (Symbol n in r)
if (name == n)
return true;
Variable vari;
node = node.FirstChild;
- if (node.Name == Ndescription)
+ if (node != null && node.Name == Ndescription)
{
desc = node.InnerText;
node = node.NextSibling;
desc = null;
if (node != null)
{
- Symbol type = node.Name;
+ XmlNode nn;
+ if (node.Name == "value")
+ nn = node.FirstChild;
+ else
+ nn = node;
+ Symbol type = nn.Name;
XmlNodeList range_list = null;
int nranges = 0;
- string val = node.InnerText;
+ string val = nn.InnerText;
node = node.NextSibling;
if (node != null)
{
range[i * 2]
= range[i * 2 + 1]
- = parse_integer (n.InnerText);
+ = parse_integer (n.FirstChild.InnerText);
}
}
}
{
range = new string[nranges];
for (int i = 0; i < nranges; i++)
- range[i] = range_list[i].InnerText;
+ range[i] = range_list[i].FirstChild.InnerText;
}
if (variables.TryGetValue (name, out vari))
{
range = new Symbol[nranges];
for (int i = 0; i < nranges; i++)
- range[i] = range_list[i].InnerText;
+ range[i] = range_list[i].FirstChild.InnerText;
}
if (variables.TryGetValue (name, out vari))
public static void Main()
{
//M17n.debug = true;
- MDatabase.ApplicationDir = "/usr/local/share/m17n-xml";
+ MDatabase.ApplicationDir = "/usr/local/share/m17n";
MText desc, title;
Xex.Variable[] vars;
MInputMethod.Command[] cmds;
Console.WriteLine (node.OuterXml);
-#elif true
+#elif false
MInputMethod im = MInputMethod.Find ("vi", "telex");
if (im.Info (out desc, out title, out vars, out cmds))
STATELIST ?
'</input-method>'
+TAGS = '<tags>' LANG NAME EXTRA ? '</tags>'
+
+LANG = '<language>' LANGNAME '</language>'
+NAME = '<name>' NAME '</name>'
+EXTRA = '<extra-id>' EXTRANAME '</extra-id>'
+
VARLIST = '<variable-list>' DEFVAR + '</variable-list>'
CMDLIST = '<command-list>' COMMAND + '</command-list>'
MODULELIST = '<module-list>' MODULE + '</module-list>'
CMDREF = '<command cname="' COMMANDNAME '"/>'
-STATE = '<state sname="' STATENAME '">' [ HOOK BRANCH CATCHALL ] * '</state>'
+STATE = '<state sname="' STATENAME '">'
+ TITLE ?
+ [ HOOK BRANCH CATCHALL ] *
+ '</state>'
HOOK = '<state-hook>' FUNCALL + '</state-hook>'
TERM += MIM-TERM
PREDEFINED += MIM-PREDEFEIND
-MIM-TERM = KEYSEQ | MARKER
+MIM-TERM = KEYSEQ | MARKER | SELECTOR
KEYSEQ = '<keyseq>' [ INTTERM | STRTERM | SYMTERM ] + '</keyseq>'
KEYSEQTERM = KEYSEQ | VAR (value is KEYSEQ) | FUNCALL (return KEYSEQ)
| SHIFT | SHIFTBACK
INSERT = '<insert>' [ INTTERM | STRTERM ] '</insert>'
-CANDIDATES = '<insert-candidates>' [ STRTERM | LISTTERM ] '</insert-candiates>'
+CANDIDATES = '<insert-candidates>' [ STRTERM | LISTTERM ] + '</insert-candiates>'
DELETE = '<delete>' [ MARKERTERM | INTTERM ] '</delete>'
-SELECT = '<select>' [ SELECTTERM | INTTERM ] '</select>'
+SELECT = '<select>' [ SELECTORTERM | INTTERM ] '</select>'
SHOW = '<show-candidates/>'
HIDE = '<hide-candidates/>'
MOVE = '<move>' [ MARKERTERM | INTTERM ] '</move>'
"\xC0"
+(\ )
(a 123 0x123)
-10
?\xC0