Beispiel #1
0
 public WTM_Node(WTM_Node parent)
 {
     this.Parent = parent;
 }
Beispiel #2
0
 void SaveNode(BinaryWriter Output, WTM_Node node)
 {
     var asInner = node as WTM_Inner;
     if (asInner != null) {
         // isInner?
         Output.Write (true);
         var arity = asInner.CHILDREN.Length;
         Output.Write ((int)arity);
         GenericIO<Sequence>.Save(Output, asInner.SEQ);
         for (int i = 0; i < arity; ++i) {
             var child = asInner.CHILDREN[i];
             if (child == null) {
                 Output.Write (false);
             } else {
                 Output.Write(true);
                 this.SaveNode(Output, child);
             }
         }
     } else {
         Output.Write (false);
         var asLeaf = node as WTM_Leaf;
         // Output.Write ((int)asLeaf.Count);
         Output.Write ((int)asLeaf.Symbol);
     }
 }