2 // This software is now distributed according to
3 // the Lesser Gnu Public License. Please see
4 // http://www.gnu.org/copyleft/lesser.txt for
8 package com.stevesoft.pat;
12 /** Implements the parenthesis pattern subelement. */
13 class OrMark extends Or
15 SubMark sm = new SubMark();
30 public Pattern getNext()
35 public int matchInternal(int pos, Pthings pt)
37 sm.next = super.getNext();
40 int n2 = 2 * pt.nMarks + 2;
41 pt.marks = new int[n2];
42 for (int i = 0; i < n2; i++)
48 int ret = super.matchInternal(pos, pt);
53 else if (pt.marks[id] > pt.marks[id + pt.nMarks])
55 int swap = pt.marks[id];
56 pt.marks[id] = pt.marks[id + pt.nMarks] + 1;
57 pt.marks[id + pt.nMarks] = swap + 1;
62 public Pattern clone1(Hashtable h)
64 OrMark om = new OrMark(id);
67 for (int i = 0; i < v.size(); i++)
69 om.v.addElement(((Pattern) v.elementAt(i)).clone(h));