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
\r
24 public static boolean RegSyntaxErrorEnabled = false;
\r
25 public RegSyntaxError()
\r
28 public RegSyntaxError(String s)
\r
33 final static void endItAll(String s)
\r
36 if (RegSyntaxErrorEnabled)
\r
38 throw new RegSyntaxError(s);
\r
40 throw new RegSyntax(s);
\r