| 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 2 | // Copyright (c) 2018 Saxonica Limited. |
| 3 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. |
| 4 | // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 5 | // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. |
| 6 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 7 | |
| 8 | /* |
| 9 | * Licensed to the Apache Software Foundation (ASF) under one or more |
| 10 | * contributor license agreements. See the NOTICE file distributed with |
| 11 | * this work for additional information regarding copyright ownership. |
| 12 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
| 13 | * (the "License"); you may not use this file except in compliance with |
| 14 | * the License. You may obtain a copy of the License at |
| 15 | * |
| 16 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 17 | * |
| 18 | * Unless required by applicable law or agreed to in writing, software |
| 19 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 21 | * See the License for the specific language governing permissions and |
| 22 | * limitations under the License. |
| 23 | */ |
| 24 | |
| 25 | package net.sf.saxon.regex; |
| 26 | |
| 27 | /** |
| 28 | * Exception thrown to indicate a syntax error in a regular expression. |
| 29 | * This is a non-checked exception because you should only have problems compiling |
| 30 | * a regular expression during development. |
| 31 | * If you are making regular expression programs dynamically then you can catch it |
| 32 | * if you wish. But should not be forced to. |
| 33 | * |
| 34 | * @author <a href="mailto:[email protected]">Jonathan Locke</a> |
| 35 | * @author <a href="mailto:[email protected]">Michael McCallum</a> |
| 36 | * @version $Id: RESyntaxException.java 518156 2007-03-14 14:31:26Z vgritsenko $ |
| 37 | */ |
| 38 | public class RESyntaxException extends RuntimeException { |
| 39 | /** |
| 40 | * Constructor. |
| 41 | * |
| 42 | * @param s Further description of the syntax error |
| 43 | */ |
| 44 | public RESyntaxException(String s) { |
| 45 | super(s); |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Constructor. |
| 50 | * |
| 51 | * @param s Further description of the syntax error |
| 52 | * @param offset character position within regex where the error was detected |
| 53 | */ |
| 54 | public RESyntaxException(String s, int offset) { |
| 55 | super("Syntax error at char " + offset + " in regular expression: " + s); |
| 56 | } |
| 57 | } |