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
10 /** When enabled, this class is thrown instead of
\r
11 the normal RegSyntax. Thus, enabling of this
\r
12 class will make your debugging easier -- but
\r
13 if you leave it on and forget to catch RegSyntaxError
\r
14 a user-supplied pattern could generate a
\r
15 RegSyntaxError that will kill your application.
\r
17 I strongly recommend turning this flag on, however,
\r
18 as I think it is more likely to help than to hurt
\r
19 your programming efforts.
\r
21 public class RegSyntaxError extends Error {
\r
22 public static boolean RegSyntaxErrorEnabled = false;
\r
23 public RegSyntaxError() {}
\r
24 public RegSyntaxError(String s) { super(s); }
\r
25 final static void endItAll(String s) throws RegSyntax {
\r
26 if(RegSyntaxErrorEnabled) throw new RegSyntaxError(s);
\r
27 throw new RegSyntax(s);
\r