All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.saxon.regex.RESyntaxException Maven / Gradle / Ivy

There is a newer version: 12.5
Show newest version
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2018-2023 Saxonica Limited
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
// This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package net.sf.saxon.regex;

import net.sf.saxon.transpile.CSharpModifiers;

/**
 * Exception thrown to indicate a syntax error in a regular expression.
 * This is a non-checked exception because you should only have problems compiling
 * a regular expression during development.
 * If you are making regular expression programs dynamically then you can catch it
 * if you wish. But should not be forced to.
 *
 * @author Jonathan Locke
 * @author Michael McCallum
 * @version $Id: RESyntaxException.java 518156 2007-03-14 14:31:26Z vgritsenko $
 */
public class RESyntaxException extends RuntimeException {
    /**
     * Constructor.
     *
     * @param s Further description of the syntax error
     */
    public RESyntaxException(String s) {
        super(s);
    }

    /**
     * Constructor.
     *
     * @param s      Further description of the syntax error
     * @param offset character position within regex where the error was detected
     */
    public RESyntaxException(String s, int offset) {
        super("Syntax error at char " + offset + " in regular expression: " + s);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy