Exemple #1
0
 public override void ToNFA(NFA pad, int from, int to)
 {
     pad.AddEdge(from, to, CC.All);
 }
Exemple #2
0
 public override void ToNFA(NFA pad, int from, int to)
 {
     int knot = pad.AddNode();
     pad.nodes_l[knot].final = true;
     pad.AddEdge(from, knot, null);
 }
Exemple #3
0
 public override void ToNFA(NFA pad, int from, int to)
 {
     for (int i = 0; i < args.Length; i++) {
         int knot = (i == args.Length - 1) ? to : pad.AddNode();
         args[i].ToNFA(pad, from, knot);
         from = knot;
     }
     if (from != to) pad.AddEdge(from, to, null);
 }
Exemple #4
0
 public override void ToNFA(NFA pad, int from, int to)
 {
     if (text.Length == 0) {
         pad.AddEdge(from, to, null);
     } else {
         int len = text.Length;
         for (int c = 0; c < len; c++) {
             int fromp = (c == len - 1) ? to : pad.AddNode();
             pad.AddEdge(from, fromp, new CC(text[c], true));
             from = fromp;
         }
     }
 }
Exemple #5
0
 public override bool ToNFA(NFA pad, int from, int to)
 {
     int knot = pad.AddNode();
     pad.SetFinal(knot);
     pad.AddEdge(from, knot, null);
     return false;
 }
Exemple #6
0
    public override void ToNFA(NFA pad, int from, int to)
    {
        int knot1 = pad.AddNode();
        int knot2 = pad.AddNode();
        int knot3 = pad.AddNode();
        pad.AddEdge(from, knot1, null);

        z0.ToNFA(pad, knot1, knot2);
        if (z1 != null)
            z1.ToNFA(pad, knot2, knot3);
        else
            pad.AddEdge(knot2, knot3, null);

        pad.AddEdge(knot2, to, null);

        if ((type & 1) != 0)
            pad.AddEdge(from, to, null);
        if ((type & 4) != 0)
            pad.AddEdge(knot3, to, null);
        if ((type & 2) != 0)
            pad.AddEdge(knot3, knot1, null);
    }
Exemple #7
0
 public override bool ToNFA(NFA pad, int from, int to)
 {
     if (text.Length == 0) {
         pad.AddEdge(from, to, null);
     } else {
         int len = text.Length;
         for (int c = 0; c < len; c++) {
             int fromp = (c == len - 1) ? to : pad.AddNode();
             pad.AddEdge(from, fromp, (int)text[c]); // XXX supplementaries
             from = fromp;
         }
     }
     return true;
 }
Exemple #8
0
 public override bool ToNFA(NFA pad, int from, int to)
 {
     pad.AddEdge(from, to, CC.All);
     return true;
 }
Exemple #9
0
 public override bool ToNFA(NFA pad, int from, int to)
 {
     for (int i = 0; i < args.Length; i++) {
         int knot = (i == args.Length - 1) ? to : pad.AddNode();
         if (!args[i].ToNFA(pad, from, knot))
             return false;
         from = knot;
     }
     if (from != to) pad.AddEdge(from, to, null);
     return true;
 }
Exemple #10
0
    public override bool ToNFA(NFA pad, int from, int to)
    {
        int knot1 = pad.AddNode();
        int knot2 = pad.AddNode();
        int knot3 = pad.AddNode();
        pad.AddEdge(from, knot1, null);

        z0.ToNFA(pad, knot1, knot2);
        if (z1 != null)
            z1.ToNFA(pad, knot2, knot3);
        else
            pad.AddEdge(knot2, knot3, null);

        pad.AddEdge(knot2, to, null);

        if ((type & 1) != 0)
            pad.AddEdge(from, to, null);
        if ((type & 4) != 0)
            pad.AddEdge(knot3, to, null);
        if ((type & 2) != 0)
            pad.AddEdge(knot3, knot1, null);
        return true; // conservative
    }
Exemple #11
0
 public override void ToNFA(NFA pad, int from, int to)
 {
     pad.AddEdge(from, to, null);
     child.ToNFA(pad, from, to);
 }
Exemple #12
0
 public override void ToNFA(NFA pad, int from, int to)
 {
     int knot = pad.AddNode();
     pad.AddEdge(from, knot, null);
     pad.AddEdge(knot, to, null);
     child.ToNFA(pad, knot, knot);
 }
Exemple #13
0
 public override void ToNFA(NFA pad, int from, int to)
 {
     int knot1 = pad.AddNode();
     int knot2 = pad.AddNode();
     pad.AddEdge(from, knot1, null);
     pad.AddEdge(knot2, to, null);
     pad.AddEdge(knot2, knot1, null);
     child.ToNFA(pad, knot1, knot2);
 }