亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? recompiler.java

?? jakarta-regexp-1.5 正則表達式的源代碼
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
/* * 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 org.apache.regexp;import java.util.Hashtable;/** * A regular expression compiler class.  This class compiles a pattern string into a * regular expression program interpretable by the RE evaluator class.  The 'recompile' * command line tool uses this compiler to pre-compile regular expressions for use * with RE.  For a description of the syntax accepted by RECompiler and what you can * do with regular expressions, see the documentation for the RE matcher class. * * @see RE * @see recompile * * @author <a href="mailto:jonl@muppetlabs.com">Jonathan Locke</a> * @author <a href="mailto:gholam@xtra.co.nz">Michael McCallum</a> * @version $Id: RECompiler.java 518156 2007-03-14 14:31:26Z vgritsenko $ */public class RECompiler{    // The compiled program    char[] instruction;                                 // The compiled RE 'program' instruction buffer    int lenInstruction;                                 // The amount of the program buffer currently in use    // Input state for compiling regular expression    String pattern;                                     // Input string    int len;                                            // Length of the pattern string    int idx;                                            // Current input index into ac    int parens;                                         // Total number of paren pairs    // Node flags    static final int NODE_NORMAL   = 0;                 // No flags (nothing special)    static final int NODE_NULLABLE = 1;                 // True if node is potentially null    static final int NODE_TOPLEVEL = 2;                 // True if top level expr    // Special types of 'escapes'    static final int ESC_MASK      = 0xffff0;           // Escape complexity mask    static final int ESC_BACKREF   = 0xfffff;           // Escape is really a backreference    static final int ESC_COMPLEX   = 0xffffe;           // Escape isn't really a true character    static final int ESC_CLASS     = 0xffffd;           // Escape represents a whole class of characters    // {m,n} stacks    static final int bracketUnbounded = -1;             // Unbounded value    int bracketMin;                                     // Minimum number of matches    int bracketOpt;                                     // Additional optional matches    // Lookup table for POSIX character class names    static final Hashtable hashPOSIX = new Hashtable();    static    {        hashPOSIX.put("alnum",     new Character(RE.POSIX_CLASS_ALNUM));        hashPOSIX.put("alpha",     new Character(RE.POSIX_CLASS_ALPHA));        hashPOSIX.put("blank",     new Character(RE.POSIX_CLASS_BLANK));        hashPOSIX.put("cntrl",     new Character(RE.POSIX_CLASS_CNTRL));        hashPOSIX.put("digit",     new Character(RE.POSIX_CLASS_DIGIT));        hashPOSIX.put("graph",     new Character(RE.POSIX_CLASS_GRAPH));        hashPOSIX.put("lower",     new Character(RE.POSIX_CLASS_LOWER));        hashPOSIX.put("print",     new Character(RE.POSIX_CLASS_PRINT));        hashPOSIX.put("punct",     new Character(RE.POSIX_CLASS_PUNCT));        hashPOSIX.put("space",     new Character(RE.POSIX_CLASS_SPACE));        hashPOSIX.put("upper",     new Character(RE.POSIX_CLASS_UPPER));        hashPOSIX.put("xdigit",    new Character(RE.POSIX_CLASS_XDIGIT));        hashPOSIX.put("javastart", new Character(RE.POSIX_CLASS_JSTART));        hashPOSIX.put("javapart",  new Character(RE.POSIX_CLASS_JPART));    }    /**     * Constructor.  Creates (initially empty) storage for a regular expression program.     */    public RECompiler()    {        // Start off with a generous, yet reasonable, initial size        instruction = new char[128];        lenInstruction = 0;    }    /**     * Ensures that n more characters can fit in the program buffer.     * If n more can't fit, then the size is doubled until it can.     * @param n Number of additional characters to ensure will fit.     */    void ensure(int n)    {        // Get current program length        int curlen = instruction.length;        // If the current length + n more is too much        if (lenInstruction + n >= curlen)        {            // Double the size of the program array until n more will fit            while (lenInstruction + n >= curlen)            {                curlen *= 2;            }            // Allocate new program array and move data into it            char[] newInstruction = new char[curlen];            System.arraycopy(instruction, 0, newInstruction, 0, lenInstruction);            instruction = newInstruction;        }    }    /**     * Emit a single character into the program stream.     * @param c Character to add     */    void emit(char c)    {        // Make room for character        ensure(1);        // Add character        instruction[lenInstruction++] = c;    }    /**     * Inserts a node with a given opcode and opdata at insertAt.  The node relative next     * pointer is initialized to 0.     * @param opcode Opcode for new node     * @param opdata Opdata for new node (only the low 16 bits are currently used)     * @param insertAt Index at which to insert the new node in the program     */    void nodeInsert(char opcode, int opdata, int insertAt)    {        // Make room for a new node        ensure(RE.nodeSize);        // Move everything from insertAt to the end down nodeSize elements        System.arraycopy(instruction, insertAt, instruction, insertAt + RE.nodeSize, lenInstruction - insertAt);        instruction[insertAt /* + RE.offsetOpcode */] = opcode;        instruction[insertAt    + RE.offsetOpdata   ] = (char) opdata;        instruction[insertAt    + RE.offsetNext     ] = 0;        lenInstruction += RE.nodeSize;    }    /**     * Appends a node to the end of a node chain     * @param node Start of node chain to traverse     * @param pointTo Node to have the tail of the chain point to     */    void setNextOfEnd(int node, int pointTo)    {        // Traverse the chain until the next offset is 0        int next = instruction[node + RE.offsetNext];        // while the 'node' is not the last in the chain        // and the 'node' is not the last in the program.        while ( next != 0 && node < lenInstruction )        {            // if the node we are supposed to point to is in the chain then            // point to the end of the program instead.            // Michael McCallum <gholam@xtra.co.nz>            // FIXME: This is a _hack_ to stop infinite programs.            // I believe that the implementation of the reluctant matches is wrong but            // have not worked out a better way yet.            if (node == pointTo) {                pointTo = lenInstruction;            }            node += next;            next = instruction[node + RE.offsetNext];        }        // if we have reached the end of the program then dont set the pointTo.        // im not sure if this will break any thing but passes all the tests.        if ( node < lenInstruction ) {            // Some patterns result in very large programs which exceed            // capacity of the short used for specifying signed offset of the            // next instruction. Example: a{1638}            int offset = pointTo - node;            if (offset != (short) offset) {                throw new RESyntaxException("Exceeded short jump range.");            }            // Point the last node in the chain to pointTo.            instruction[node + RE.offsetNext] = (char) (short) offset;        }    }    /**     * Adds a new node     * @param opcode Opcode for node     * @param opdata Opdata for node (only the low 16 bits are currently used)     * @return Index of new node in program     */    int node(char opcode, int opdata)    {        // Make room for a new node        ensure(RE.nodeSize);        // Add new node at end        instruction[lenInstruction /* + RE.offsetOpcode */] = opcode;        instruction[lenInstruction    + RE.offsetOpdata   ] = (char) opdata;        instruction[lenInstruction    + RE.offsetNext     ] = 0;        lenInstruction += RE.nodeSize;        // Return index of new node        return lenInstruction - RE.nodeSize;    }    /**     * Throws a new internal error exception     * @exception Error Thrown in the event of an internal error.     */    void internalError() throws Error    {        throw new Error("Internal error!");    }    /**     * Throws a new syntax error exception     * @exception RESyntaxException Thrown if the regular expression has invalid syntax.     */    void syntaxError(String s) throws RESyntaxException    {        throw new RESyntaxException(s);    }    /**     * Match bracket {m,n} expression put results in bracket member variables     * @exception RESyntaxException Thrown if the regular expression has invalid syntax.     */    void bracket() throws RESyntaxException    {        // Current character must be a '{'        if (idx >= len || pattern.charAt(idx++) != '{')        {            internalError();        }        // Next char must be a digit        if (idx >= len || !Character.isDigit(pattern.charAt(idx)))        {            syntaxError("Expected digit");        }        // Get min ('m' of {m,n}) number        StringBuffer number = new StringBuffer();        while (idx < len && Character.isDigit(pattern.charAt(idx)))        {            number.append(pattern.charAt(idx++));        }        try        {            bracketMin = Integer.parseInt(number.toString());        }        catch (NumberFormatException e)        {            syntaxError("Expected valid number");        }        // If out of input, fail        if (idx >= len)        {            syntaxError("Expected comma or right bracket");        }        // If end of expr, optional limit is 0        if (pattern.charAt(idx) == '}')        {            idx++;            bracketOpt = 0;            return;        }        // Must have at least {m,} and maybe {m,n}.        if (idx >= len || pattern.charAt(idx++) != ',')        {            syntaxError("Expected comma");        }        // If out of input, fail        if (idx >= len)        {            syntaxError("Expected comma or right bracket");        }        // If {m,} max is unlimited        if (pattern.charAt(idx) == '}')        {            idx++;            bracketOpt = bracketUnbounded;            return;        }        // Next char must be a digit        if (idx >= len || !Character.isDigit(pattern.charAt(idx)))        {            syntaxError("Expected digit");        }        // Get max number        number.setLength(0);        while (idx < len && Character.isDigit(pattern.charAt(idx)))        {            number.append(pattern.charAt(idx++));        }        try        {            bracketOpt = Integer.parseInt(number.toString()) - bracketMin;        }        catch (NumberFormatException e)        {            syntaxError("Expected valid number");        }        // Optional repetitions must be >= 0        if (bracketOpt < 0)        {            syntaxError("Bad range");        }        // Must have close brace        if (idx >= len || pattern.charAt(idx++) != '}')        {            syntaxError("Missing close brace");        }    }    /**     * Match an escape sequence.  Handles quoted chars and octal escapes as well     * as normal escape characters.  Always advances the input stream by the     * right amount. This code "understands" the subtle difference between an     * octal escape and a backref.  You can access the type of ESC_CLASS or     * ESC_COMPLEX or ESC_BACKREF by looking at pattern[idx - 1].     * @return ESC_* code or character if simple escape     * @exception RESyntaxException Thrown if the regular expression has invalid syntax.     */    int escape() throws RESyntaxException    {        // "Shouldn't" happen        if (pattern.charAt(idx) != '\\')        {            internalError();        }        // Escape shouldn't occur as last character in string!        if (idx + 1 == len)        {            syntaxError("Escape terminates string");        }        // Switch on character after backslash        idx += 2;        char escapeChar = pattern.charAt(idx - 1);        switch (escapeChar)        {            case RE.E_BOUND:            case RE.E_NBOUND:                return ESC_COMPLEX;            case RE.E_ALNUM:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产黄人亚洲片| 美女mm1313爽爽久久久蜜臀| 日韩欧美的一区| 538在线一区二区精品国产| 91成人免费电影| 色婷婷久久久综合中文字幕| 99久久精品国产毛片| 国产成a人亚洲精| 成人国产精品免费观看| 91在线码无精品| 91成人免费电影| 在线不卡中文字幕| 日韩写真欧美这视频| 欧美v国产在线一区二区三区| 日韩美女在线视频| 国产欧美综合色| 日韩理论片网站| 五月天激情综合网| 精品在线一区二区| 成人手机电影网| 在线免费视频一区二区| 欧美精品在欧美一区二区少妇| 日韩视频免费观看高清完整版在线观看| 日韩一区二区三区精品视频| 精品国产污网站| 亚洲国产精品成人综合| 亚洲免费色视频| 蜜桃久久久久久久| 成人av动漫网站| 欧洲av一区二区嗯嗯嗯啊| 日韩一区二区精品在线观看| 国产欧美日韩三区| 亚洲一二三区在线观看| 国内国产精品久久| 91在线一区二区| 欧美伦理视频网站| 精品欧美一区二区三区精品久久 | 国产欧美一区二区精品忘忧草 | 精品入口麻豆88视频| 亚洲国产精品激情在线观看| 中文字幕av一区二区三区高| 亚洲综合在线五月| 韩国视频一区二区| 日韩电影在线免费观看| 国产精品一区二区黑丝| 91看片淫黄大片一级| 日韩欧美中文一区二区| 国产精品成人在线观看| 美女视频网站黄色亚洲| 欧美在线视频全部完| 国产日韩av一区二区| 午夜精品久久久久久久久| 国产精品18久久久久久久网站| 欧洲色大大久久| 国产精品女主播av| 激情五月激情综合网| 欧美日韩成人综合| 亚洲乱码国产乱码精品精可以看 | 中文子幕无线码一区tr| 午夜久久电影网| 色综合欧美在线视频区| 久久噜噜亚洲综合| 欧美aaaaaa午夜精品| 91福利精品视频| 日韩码欧中文字| 成人综合婷婷国产精品久久| 7777精品伊人久久久大香线蕉完整版 | 色综合久久99| 极品瑜伽女神91| 欧美色图第一页| 欧美国产一区二区在线观看| 久久疯狂做爰流白浆xx| 欧美日韩成人综合天天影院| 亚洲天堂av一区| eeuss影院一区二区三区| 久久只精品国产| 久久99九九99精品| 日韩欧美电影一区| 麻豆成人久久精品二区三区红| 欧美日韩精品福利| 亚洲不卡av一区二区三区| 91麻豆高清视频| 一区二区三区在线视频免费观看| 成人黄色av网站在线| 日本一区二区高清| 国产福利91精品一区| 国产三级精品三级| 国产成人综合亚洲网站| 久久天堂av综合合色蜜桃网| 国产乱码精品一区二区三区忘忧草| 日韩亚洲欧美一区二区三区| 久久国产精品露脸对白| 久久久久久久综合| 成熟亚洲日本毛茸茸凸凹| 成人欧美一区二区三区| 91麻豆国产香蕉久久精品| 亚洲电影中文字幕在线观看| 欧美日韩一区视频| 麻豆91在线播放| 久久久久久久久久久久久女国产乱| 国产乱淫av一区二区三区 | 中文字幕精品—区二区四季| av一区二区三区四区| 亚洲制服丝袜在线| 欧美酷刑日本凌虐凌虐| 美国精品在线观看| 欧美经典一区二区| 在线亚洲免费视频| 另类小说视频一区二区| 久久久.com| 欧美日韩免费电影| 韩国一区二区三区| 樱花影视一区二区| 日韩一级高清毛片| 不卡av免费在线观看| 五月天婷婷综合| 国产欧美一区视频| 欧美男同性恋视频网站| 国产精品夜夜嗨| 亚洲精品日韩专区silk| 精品久久久久久久久久久久久久久久久| 福利一区在线观看| 亚洲成a人v欧美综合天堂下载| 2022国产精品视频| 欧美亚洲综合久久| 国产一二三精品| 亚洲小少妇裸体bbw| 国产亚洲视频系列| 91精品综合久久久久久| 成人av在线播放网址| 美女视频黄久久| 亚洲综合图片区| 国产日韩av一区二区| 91精品国产综合久久婷婷香蕉 | 欧美亚洲图片小说| 国产精品一区二区三区乱码| 亚洲va欧美va国产va天堂影院| 国产亚洲欧美色| 欧美一级欧美三级在线观看 | 亚洲专区一二三| 久久久久久久久久久久久夜| 欧美日韩国产免费| 91视频免费看| 国产精品自在欧美一区| 天天综合天天综合色| 亚洲视频综合在线| 欧美激情综合五月色丁香| 日韩精品一区在线| 91精品婷婷国产综合久久性色 | 性欧美疯狂xxxxbbbb| 亚洲日本va在线观看| 久久九九影视网| 精品理论电影在线| 日韩一区二区三区四区| 7777女厕盗摄久久久| 欧美日韩高清影院| 欧美三区在线观看| 91久久奴性调教| 欧美最新大片在线看 | 亚洲午夜一二三区视频| 国产精品成人午夜| 中文字幕综合网| 一区在线观看免费| 国产拍揄自揄精品视频麻豆| 国产午夜亚洲精品羞羞网站| 欧美电影精品一区二区| 精品国产99国产精品| 日韩精品一区二区三区视频| 日韩欧美国产精品| 精品国内片67194| 精品久久一区二区三区| 久久精品一区二区三区不卡 | 欧美成人三级在线| 精品国产一区二区在线观看| 日韩午夜激情电影| 久久色在线视频| 国产欧美日韩综合精品一区二区| 中文一区一区三区高中清不卡| 国产精品久久久久久久浪潮网站| 一区视频在线播放| 亚洲制服丝袜在线| 美女视频黄免费的久久| 国产一区91精品张津瑜| 99re66热这里只有精品3直播| 99久久精品国产麻豆演员表| 欧美在线制服丝袜| 精品欧美久久久| 中文字幕在线不卡视频| 亚洲黄色小视频| 日本大胆欧美人术艺术动态| 精品一区二区国语对白| 国产成人精品在线看| 91成人在线精品| 日韩精品一区在线| 日韩码欧中文字| 久久精品国产在热久久| av不卡在线播放| 欧美一区二区三区免费大片| 国产区在线观看成人精品| 亚洲精品久久久蜜桃|