2 // This software is now distributed according to
\r
3 // the Lesser Gnu Public License. Please see
\r
4 // http://www.gnu.org/copyleft/lesser.txt for
\r
6 // -- Happy Computing!
\r
8 package com.stevesoft.pat;
\r
13 * This class implements the (?@<>) syntax that matches a balanced parenthesis.
\r
16 class Group extends Pattern
\r
20 Group(char opi, char cli)
\r
26 public int matchInternal(int pos, Pthings pt)
\r
29 if (pos < pt.src.length())
\r
31 if (!Masked(pos, pt) && pt.src.charAt(pos) != op)
\r
36 for (i = pos + 1; i < pt.src.length(); i++)
\r
38 char c = pt.src.charAt(i);
\r
39 boolean b = !Masked(i, pt);
\r
52 return nextMatch(i + 1, pt);
\r
63 public String toString()
\r
65 return "(?@" + op + cl + ")" + nextString();
\r
68 public patInt minChars()
\r
70 return new patInt(2);
\r
73 Pattern clone1(Hashtable h)
\r
75 return new Group(op, cl);
\r