681135cefe09fc85956a05a3f8345280e6d20756
[jalviewjs.git] / unused / com / stevesoft / pat / RegSyntaxError.java
1 //\r
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
5 // the details.\r
6 //    -- Happy Computing!\r
7 //\r
8 package com.stevesoft.pat;\r
9 \r
10 /**\r
11  * When enabled, this class is thrown instead of the normal RegSyntax. Thus,\r
12  * enabling of this class will make your debugging easier -- but if you leave it\r
13  * on and forget to catch RegSyntaxError a user-supplied pattern could generate\r
14  * a RegSyntaxError that will kill your application.\r
15  * \r
16  * I strongly recommend turning this flag on, however, as I think it is more\r
17  * likely to help than to hurt your programming efforts.\r
18  */\r
19 public class RegSyntaxError extends Error\r
20 {\r
21   public static boolean RegSyntaxErrorEnabled = false;\r
22 \r
23   public RegSyntaxError()\r
24   {\r
25   }\r
26 \r
27   public RegSyntaxError(String s)\r
28   {\r
29     super(s);\r
30   }\r
31 \r
32   final static void endItAll(String s) throws RegSyntax\r
33   {\r
34     if (RegSyntaxErrorEnabled)\r
35     {\r
36       throw new RegSyntaxError(s);\r
37     }\r
38     throw new RegSyntax(s);\r
39   }\r
40 }\r