⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 resyntax.java

📁 gcc的组建
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/* gnu/regexp/RESyntax.java   Copyright (C) 2006 Free Software Foundation, Inc.This file is part of GNU Classpath.GNU Classpath is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2, or (at your option)any later version.GNU Classpath is distributed in the hope that it will be useful, butWITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNUGeneral Public License for more details.You should have received a copy of the GNU General Public Licensealong with GNU Classpath; see the file COPYING.  If not, write to theFree Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA02110-1301 USA.Linking this library statically or dynamically with other modules ismaking a combined work based on this library.  Thus, the terms andconditions of the GNU General Public License cover the wholecombination.As a special exception, the copyright holders of this library give youpermission to link this library with independent modules to produce anexecutable, regardless of the license terms of these independentmodules, and to copy and distribute the resulting executable underterms of your choice, provided that you also meet, for each linkedindependent module, the terms and conditions of the license of thatmodule.  An independent module is a module which is not derived fromor based on this library.  If you modify this library, you may extendthis exception to your version of the library, but you are notobligated to do so.  If you do not wish to do so, delete thisexception statement from your version. */package gnu.regexp;import java.io.Serializable;import java.util.BitSet;/** * An RESyntax specifies the way a regular expression will be compiled. * This class provides a number of predefined useful constants for * emulating popular regular expression syntaxes.  Additionally the * user may construct his or her own syntax, using any combination of the * syntax bit constants.  The syntax is an optional argument to any of the * matching methods on class RE. * * @author <A HREF="mailto:wes@cacas.org">Wes Biggs</A> */public final class RESyntax implements Serializable {    static final String DEFAULT_LINE_SEPARATOR = System.getProperty("line.separator");    private static final String SYNTAX_IS_FINAL = RE.getLocalizedMessage("syntax.final");    private BitSet bits;    // true for the constant defined syntaxes    private boolean isFinal = false;    private String lineSeparator = DEFAULT_LINE_SEPARATOR;  // Values for constants are bit indexes  /**   * Syntax bit. Backslash is an escape character in lists.   */  public static final int RE_BACKSLASH_ESCAPE_IN_LISTS =  0;  /**   * Syntax bit. Use \? instead of ? and \+ instead of +.   */  public static final int RE_BK_PLUS_QM                =  1;  /**   * Syntax bit. POSIX character classes ([:...:]) in lists are allowed.   */  public static final int RE_CHAR_CLASSES              =  2;  /**   * Syntax bit. ^ and $ are special everywhere.   * <B>Not implemented.</B>   */  public static final int RE_CONTEXT_INDEP_ANCHORS     =  3;   /**   * Syntax bit. Repetition operators are only special in valid positions.   * <B>Not implemented.</B>   */  public static final int RE_CONTEXT_INDEP_OPS         =  4;   /**   * Syntax bit. Repetition and alternation operators are invalid   * at start and end of pattern and other places.    * <B>Not implemented</B>.   */  public static final int RE_CONTEXT_INVALID_OPS       =  5;   /**   * Syntax bit. Match-any-character operator (.) matches a newline.   */  public static final int RE_DOT_NEWLINE               =  6;  /**   * Syntax bit. Match-any-character operator (.) does not match a null.   */  public static final int RE_DOT_NOT_NULL              =  7;  /**   * Syntax bit. Intervals ({x}, {x,}, {x,y}) are allowed.   */  public static final int RE_INTERVALS                 =  8;  /**   * Syntax bit. No alternation (|), match one-or-more (+), or    * match zero-or-one (?) operators.   */  public static final int RE_LIMITED_OPS               =  9;  /**   * Syntax bit. Newline is an alternation operator.   */  public static final int RE_NEWLINE_ALT               = 10; // impl.  /**   * Syntax bit. Intervals use { } instead of \{ \}   */  public static final int RE_NO_BK_BRACES              = 11;   /**   * Syntax bit. Grouping uses ( ) instead of \( \).   */  public static final int RE_NO_BK_PARENS              = 12;  /**   * Syntax bit. Backreferences not allowed.   */  public static final int RE_NO_BK_REFS                = 13;  /**   * Syntax bit. Alternation uses | instead of \|   */  public static final int RE_NO_BK_VBAR                = 14;  /**   * Syntax bit. <B>Not implemented</B>.   */  public static final int RE_NO_EMPTY_RANGES           = 15;  /**   * Syntax bit. An unmatched right parenthesis (')' or '\)', depending   * on RE_NO_BK_PARENS) will throw an exception when compiling.   */  public static final int RE_UNMATCHED_RIGHT_PAREN_ORD = 16;  /**   * Syntax bit. <B>Not implemented.</B>   */  public static final int RE_HAT_LISTS_NOT_NEWLINE     = 17;  /**   * Syntax bit.  Stingy matching is allowed (+?, *?, ??, {x,y}?).   */  public static final int RE_STINGY_OPS                = 18;  /**   * Syntax bit. Allow character class escapes (\d, \D, \s, \S, \w, \W).   */  public static final int RE_CHAR_CLASS_ESCAPES        = 19;  /**   * Syntax bit. Allow use of (?:xxx) grouping (subexpression is not saved).   */  public static final int RE_PURE_GROUPING             = 20;  /**   * Syntax bit. Allow use of (?=xxx) and (?!xxx) apply the subexpression   * to the text following the current position without consuming that text.   */  public static final int RE_LOOKAHEAD                 = 21;  /**   * Syntax bit. Allow beginning- and end-of-string anchors (\A, \Z).   */  public static final int RE_STRING_ANCHORS            = 22;  /**   * Syntax bit. Allow embedded comments, (?#comment), as in Perl5.   */  public static final int RE_COMMENTS                  = 23;  /**   * Syntax bit. Allow character class escapes within lists, as in Perl5.   */  public static final int RE_CHAR_CLASS_ESC_IN_LISTS   = 24;  /**   * Syntax bit.  Possessive matching is allowed (++, *+, ?+, {x,y}+).   */  public static final int RE_POSSESSIVE_OPS            = 25;  /**   * Syntax bit.  Allow embedded flags, (?is-x), as in Perl5.   */  public static final int RE_EMBEDDED_FLAGS            = 26;  /**   * Syntax bit.  Allow octal char (\0377), as in Perl5.   */  public static final int RE_OCTAL_CHAR                = 27;  /**   * Syntax bit.  Allow hex char (\x1b), as in Perl5.   */  public static final int RE_HEX_CHAR                  = 28;  /**   * Syntax bit.  Allow Unicode char (\u1234), as in Java 1.4.   */  public static final int RE_UNICODE_CHAR              = 29;  /**   * Syntax bit.  Allow named property (\p{P}, \P{p}), as in Perl5.   */  public static final int RE_NAMED_PROPERTY            = 30;  /**   * Syntax bit.  Allow nested characterclass ([a-z&&[^p-r]]), as in Java 1.4.   */  public static final int RE_NESTED_CHARCLASS          = 31;  private static final int BIT_TOTAL                   = 32;  /**   * Predefined syntax.   * Emulates regular expression support in the awk utility.   */  public static final RESyntax RE_SYNTAX_AWK;  /**   * Predefined syntax.   * Emulates regular expression support in the ed utility.   */  public static final RESyntax RE_SYNTAX_ED;  /**   * Predefined syntax.   * Emulates regular expression support in the egrep utility.   */  public static final RESyntax RE_SYNTAX_EGREP;  /**   * Predefined syntax.   * Emulates regular expression support in the GNU Emacs editor.   */  public static final RESyntax RE_SYNTAX_EMACS;  /**   * Predefined syntax.   * Emulates regular expression support in the grep utility.   */  public static final RESyntax RE_SYNTAX_GREP;  /**   * Predefined syntax.   * Emulates regular expression support in the POSIX awk specification.   */  public static final RESyntax RE_SYNTAX_POSIX_AWK;  /**   * Predefined syntax.   * Emulates POSIX basic regular expression support.   */  public static final RESyntax RE_SYNTAX_POSIX_BASIC;  /**   * Predefined syntax.   * Emulates regular expression support in the POSIX egrep specification.   */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -