Exemplo n.º 1
0
 private static XmlNode BuildInnerContextNode(InnerContextNode IN, XmlDocument Doc)
 {
     XmlElement icNode = Doc.CreateElement("i");
     XmlAttribute icNodeType = Doc.CreateAttribute("Type");
     icNodeType.InnerText = IN.Type;
     icNode.Attributes.Append(icNodeType);
     icNode.InnerText = string.Join(" ", IN.Name);
     return icNode;
 }
Exemplo n.º 2
0
 private static InnerContextNode TryReadInnerContextNode(XmlNode Node, dynamic Lexer)
 {
     InnerContextNode Result = new InnerContextNode();
     Result.Name = new List<string>();
     Result.Type = Node.Attributes["Type"]?.InnerText;
     Result.Name = TokenizeString(Node.InnerText, Lexer);
     return Result;
 }
Exemplo n.º 3
0
 private static List<InnerContextNode> TryReadInnerContext(XmlNode Node)
 {
     List<InnerContextNode> Result = new List<InnerContextNode>();
     foreach (XmlNode subNode in Node.ChildNodes)
     {
         List<string> name = new List<string>();
         XmlNode NameNode = TryFindNode(subNode, "Name");
         InnerContextNode IC = new InnerContextNode();
         IC.Name = TryReadListOfStrings(NameNode);
         IC.Type = TryFindValue(Node, "Type");
         Result.Add(IC);
     }
     return Result;
 }
Exemplo n.º 4
0
 private static InnerContextNode TryReadInnerContextNode(XmlNode Node)
 {
     InnerContextNode Result = new InnerContextNode();
     Result.Name = new List<string>();
     foreach (XmlAttribute attr in Node.Attributes)
         if (attr.Name == "Type")
             Result.Type = attr.InnerText;
     foreach (XmlNode subNode in Node.ChildNodes)
     {
         if (subNode.Name == "string")
             Result.Name.Add(subNode.InnerText);
         else
             Result.SubNodes.Add(TryReadInnerContextNode(subNode));
     }
     return Result;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Преобразует внутренний контекст в список списков лексем
 /// </summary>
 /// <param name="Node"></param>
 /// <returns></returns>
 private static List<List<string>> ConvertInnerContextToList(InnerContextNode Node)
 {
     List<List<string>> Result = new List<List<string>>();
     Result.Add(Node.Name);
     if (Node.SubNodes != null)
         foreach (InnerContextNode subnode in Node.SubNodes)
             Result.AddRange(ConvertInnerContextToList(subnode));
     return Result;
 }