-//
-// This software is now distributed according to
-// the Lesser Gnu Public License. Please see
-// http://www.gnu.org/copyleft/lesser.txt for
-// the details.
-// -- Happy Computing!
-//
-package com.stevesoft.pat;
-
-import java.util.*;
-
-/**
- * The Bracket is a form of the Or class, implements the pattern element [ ].
- */
-class Bracket extends Or
-{
- boolean neg;
-
- Bracket(boolean n)
- {
- neg = n;
- }
-
- String leftForm()
- {
- if (neg)
- {
- return "[^";
- }
- else
- {
- return "[";
- }
- }
-
- String rightForm()
- {
- return "]";
- }
-
- String sepForm()
- {
- return "";
- }
-
- public int matchInternal(int pos, Pthings pt)
- {
- if (pos >= pt.src.length())
- {
- return -1;
- }
- int r = super.matchInternal(pos, pt);
- if ((neg && r < 0) || (!neg && r >= 0))
- {
- return nextMatch(pos + 1, pt);
- }
- return -1;
- }
-
- public patInt minChars()
- {
- return new patInt(1);
- }
-
- public patInt maxChars()
- {
- return new patInt(1);
- }
-
- public Or addOr(Pattern p)
- {
- pv = null;
- v.addElement(p);
- p.setParent(null);
- return this;
- }
-
- public Pattern clone1(Hashtable h)
- {
- Bracket b = new Bracket(neg);
- b.v = new Vector();
- for (int i = 0; i < v.size(); i++)
- {
- b.v.addElement(((Pattern) v.elementAt(i)).clone1(h));
- }
- return b;
- }
-};
+//\r
+// This software is now distributed according to\r
+// the Lesser Gnu Public License. Please see\r
+// http://www.gnu.org/copyleft/lesser.txt for\r
+// the details.\r
+// -- Happy Computing!\r
+//\r
+package com.stevesoft.pat;\r
+\r
+import java.util.*;\r
+\r
+/**\r
+ * The Bracket is a form of the Or class, implements the pattern element [ ].\r
+ */\r
+class Bracket extends Or\r
+{\r
+ boolean neg;\r
+\r
+ Bracket(boolean n)\r
+ {\r
+ neg = n;\r
+ }\r
+\r
+ String leftForm()\r
+ {\r
+ if (neg)\r
+ {\r
+ return "[^";\r
+ }\r
+ else\r
+ {\r
+ return "[";\r
+ }\r
+ }\r
+\r
+ String rightForm()\r
+ {\r
+ return "]";\r
+ }\r
+\r
+ String sepForm()\r
+ {\r
+ return "";\r
+ }\r
+\r
+ public int matchInternal(int pos, Pthings pt)\r
+ {\r
+ if (pos >= pt.src.length())\r
+ {\r
+ return -1;\r
+ }\r
+ int r = super.matchInternal(pos, pt);\r
+ if ((neg && r < 0) || (!neg && r >= 0))\r
+ {\r
+ return nextMatch(pos + 1, pt);\r
+ }\r
+ return -1;\r
+ }\r
+\r
+ public patInt minChars()\r
+ {\r
+ return new patInt(1);\r
+ }\r
+\r
+ public patInt maxChars()\r
+ {\r
+ return new patInt(1);\r
+ }\r
+\r
+ public Or addOr(Pattern p)\r
+ {\r
+ pv = null;\r
+ v.addElement(p);\r
+ p.setParent(null);\r
+ return this;\r
+ }\r
+\r
+ public Pattern clone1(Hashtable h)\r
+ {\r
+ Bracket b = new Bracket(neg);\r
+ b.v = new Vector();\r
+ for (int i = 0; i < v.size(); i++)\r
+ {\r
+ b.v.addElement(((Pattern) v.elementAt(i)).clone1(h));\r
+ }\r
+ return b;\r
+ }\r
+};\r