public void MakeSequence(Graph g1, Graph g2) { Node p = g1.r.next; g1.r.next = g2.l; // link head node while (p != null) { // link substructure Node q = p.next; p.next = g2.l; p.up = true; p = q; } g1.r = g2.r; }
public void MakeOption(Graph g) { g.l = NewNode(Node.opt, g.l); g.l.next = g.r; g.r = g.l; }
public void MakeIteration(Graph g) { g.l = NewNode(Node.iter, g.l); Node p = g.r; g.r = g.l; while (p != null) { Node q = p.next; p.next = g.l; p.up = true; p = q; } }
public void MakeFirstAlt(Graph g) { g.l = NewNode(Node.alt, g.l); g.l.line = g.l.sub.line; g.l.next = g.r; g.r = g.l; }
public void MakeAlternative(Graph g1, Graph g2) { g2.l = NewNode(Node.alt, g2.l); g2.l.line = g2.l.sub.line; Node p = g1.l; while (p.down != null) p = p.down; p.down = g2.l; p = g1.r; while (p.next != null) p = p.next; p.next = g2.r; }
public void Finish(Graph g) { Node p = g.r; while (p != null) { Node q = p.next; p.next = null; p = q; } }