/* The following code was generated by JFlex 1.7.0-SNAPSHOT tweaked for IntelliJ platform */ /* It's an automatically generated code. Do not modify it. */ package org.intellij.lang.regexp; import com.intellij.lexer.FlexLexer; import com.intellij.psi.StringEscapesTokenTypes; import com.intellij.psi.tree.IElementType; import com.intellij.util.containers.IntArrayList; import java.util.EnumSet; import static org.intellij.lang.regexp.RegExpCapability.*; @SuppressWarnings("ALL") /** * This class is a scanner generated by * <a href="http://www.jflex.de/">JFlex</a> 1.7.0-SNAPSHOT * from the specification file <tt>regexp-lexer.flex</tt> */ class _RegExLexer implements FlexLexer { /** This character denotes the end of file */ public static final int YYEOF = -1; /** initial size of the lookahead buffer */ private static final int ZZ_BUFFERSIZE = 16384; /** lexical states */ public static final int YYINITIAL = 0; public static final int QUOTED = 2; public static final int EMBRACED = 4; public static final int QUANTIFIER = 6; public static final int NEGATED_CLASS = 8; public static final int QUOTED_CLASS1 = 10; public static final int CLASS1 = 12; public static final int CLASS2 = 14; public static final int PROP = 16; public static final int NAMED = 18; public static final int OPTIONS = 20; public static final int COMMENT = 22; public static final int NAMED_GROUP = 24; public static final int QUOTED_NAMED_GROUP = 26; public static final int PY_NAMED_GROUP_REF = 28; public static final int PY_COND_REF = 30; public static final int BRACKET_EXPRESSION = 32; public static final int EMBRACED_HEX = 34; /** * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l * at the beginning of a line * l is of the form l = 2*k, k a non negative integer */ private static final int ZZ_LEXSTATE[] = { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17 }; /** * Translates characters to character classes * Chosen bits are [11, 6, 4] * Total runtime size is 13728 bytes */ public static int ZZ_CMAP(int ch) { return ZZ_CMAP_A[(ZZ_CMAP_Y[(ZZ_CMAP_Z[ch>>10]<<6)|((ch>>4)&0x3f)]<<4)|(ch&0xf)]; } /* The ZZ_CMAP_Z table has 1088 entries */ static final char ZZ_CMAP_Z[] = zzUnpackCMap( "\1\0\1\1\1\2\1\3\1\4\1\5\1\6\1\7\1\10\2\11\1\12\1\13\6\14\1\15\23\14\1\16"+ "\1\14\1\17\1\20\12\14\1\21\10\11\1\22\1\23\1\24\1\25\1\26\1\27\1\30\1\31\1"+ "\32\1\11\1\33\1\34\2\11\1\14\1\35\3\11\1\36\10\11\1\37\1\40\20\11\1\41\2\11"+ "\1\42\5\11\1\43\4\11\1\44\1\45\4\11\51\14\1\46\3\14\1\47\1\50\4\14\1\51\12"+ "\11\1\52\u0381\11"); /* The ZZ_CMAP_Y table has 2752 entries */ static final char ZZ_CMAP_Y[] = zzUnpackCMap( "\1\0\1\1\1\2\1\3\1\4\1\5\1\6\1\7\2\1\1\10\1\11\1\12\1\13\1\12\1\13\34\12\1"+ "\14\1\15\1\16\10\1\1\17\1\20\1\12\1\21\4\12\1\22\10\12\1\23\12\12\1\24\1\12"+ "\1\25\1\24\1\12\1\26\4\1\1\12\1\27\1\30\2\1\2\12\1\27\1\1\1\31\1\24\5\12\1"+ "\32\1\33\1\34\1\1\1\35\1\12\1\1\1\36\5\12\1\37\1\40\1\41\1\12\1\27\1\42\1"+ "\12\1\43\1\44\1\1\1\12\1\45\4\1\1\12\1\46\4\1\1\47\2\12\1\50\1\1\1\51\1\52"+ "\1\24\1\53\1\54\1\55\1\56\1\57\1\60\1\52\1\15\1\61\1\54\1\55\1\62\1\1\1\63"+ "\1\64\1\65\1\66\1\21\1\55\1\67\1\1\1\70\1\52\1\71\1\72\1\54\1\55\1\67\1\1"+ "\1\60\1\52\1\40\1\73\1\74\1\75\1\76\1\1\1\70\1\64\1\1\1\77\1\35\1\55\1\50"+ "\1\1\1\100\1\52\1\1\1\77\1\35\1\55\1\101\1\1\1\57\1\52\1\102\1\77\1\35\1\12"+ "\1\103\1\57\1\104\1\52\1\105\1\106\1\107\1\12\1\110\1\111\1\1\1\64\1\1\1\24"+ "\2\12\1\112\1\111\1\113\2\1\1\114\1\115\1\116\1\117\1\120\1\121\2\1\1\70\1"+ "\1\1\113\1\1\1\122\1\12\1\123\1\1\1\124\7\1\2\12\1\27\1\104\1\113\1\125\1"+ "\126\1\127\1\130\1\113\2\12\1\131\2\12\1\132\24\12\1\133\1\134\2\12\1\133"+ "\2\12\1\135\1\136\1\13\3\12\1\136\3\12\1\27\2\1\1\12\1\1\5\12\1\137\1\24\45"+ "\12\1\140\1\12\1\24\1\27\4\12\1\27\1\141\1\142\1\15\1\12\1\15\1\12\1\15\1"+ "\142\1\70\3\12\1\143\1\1\1\144\1\113\2\1\1\113\5\12\1\26\2\12\1\145\4\12\1"+ "\37\1\12\1\146\2\1\1\64\1\12\1\147\1\46\2\12\1\150\1\12\1\76\1\113\2\1\1\12"+ "\1\111\3\12\1\46\2\1\2\113\1\151\5\1\1\106\2\12\1\143\1\152\1\113\2\1\1\153"+ "\1\12\1\154\1\41\2\12\1\37\1\1\2\12\1\143\1\1\1\155\1\41\1\12\1\147\6\1\1"+ "\156\1\157\14\12\4\1\21\12\1\137\2\12\1\137\1\160\1\12\1\147\3\12\1\161\1"+ "\162\1\163\1\123\1\162\7\1\1\164\1\1\1\123\6\1\1\165\1\166\1\167\1\170\1\171"+ "\3\1\1\172\147\1\2\12\1\146\2\12\1\146\10\12\1\173\1\174\2\12\1\131\3\12\1"+ "\175\1\1\1\12\1\111\4\176\4\1\1\104\35\1\1\177\2\1\1\200\1\24\4\12\1\201\1"+ "\24\4\12\1\132\1\106\1\12\1\147\1\24\4\12\1\146\1\1\1\12\1\27\3\1\1\12\40"+ "\1\133\12\1\37\4\1\135\12\1\37\2\1\10\12\1\123\4\1\2\12\1\147\20\12\1\123"+ "\1\12\1\202\1\1\2\12\1\146\1\104\1\12\1\147\4\12\1\37\2\1\1\203\1\204\5\12"+ "\1\205\1\12\1\147\1\26\3\1\1\203\1\206\1\12\1\30\1\1\3\12\1\143\1\204\2\12"+ "\1\143\1\1\1\113\1\1\1\207\1\41\1\12\1\37\1\12\1\111\1\1\1\12\1\123\1\47\2"+ "\12\1\30\1\104\1\113\1\210\1\211\2\12\1\45\1\1\1\212\1\113\1\12\1\213\3\12"+ "\1\214\1\215\1\216\1\27\1\65\1\217\1\220\1\176\2\12\1\132\1\37\7\12\1\30\1"+ "\113\72\12\1\143\1\12\1\221\2\12\1\150\20\1\26\12\1\147\6\12\1\76\2\1\1\111"+ "\1\222\1\55\1\223\1\224\6\12\1\15\1\1\1\153\25\12\1\147\1\1\4\12\1\204\2\12"+ "\1\26\2\1\1\150\7\1\1\210\7\12\1\123\1\1\1\113\1\24\1\27\1\24\1\27\1\225\4"+ "\12\1\146\1\226\1\227\2\1\1\230\1\12\1\13\1\231\2\147\2\1\7\12\1\27\30\1\1"+ "\12\1\123\3\12\1\70\2\1\2\12\1\1\1\12\1\232\2\12\1\37\1\12\1\147\2\12\1\233"+ "\3\1\11\12\1\147\1\113\5\1\2\12\1\26\3\12\1\143\11\1\23\12\1\111\1\12\1\37"+ "\1\26\11\1\1\234\2\12\1\235\1\12\1\37\1\12\1\111\1\12\1\146\4\1\1\12\1\236"+ "\1\12\1\37\1\12\1\76\4\1\3\12\1\237\4\1\1\70\1\240\1\12\1\143\2\1\1\12\1\123"+ "\1\12\1\123\2\1\1\122\1\12\1\46\1\1\3\12\1\37\1\12\1\37\1\12\1\30\1\12\1\15"+ "\6\1\4\12\1\45\3\1\3\12\1\30\3\12\1\30\60\1\1\153\2\12\1\26\2\1\1\64\1\1\1"+ "\153\2\12\2\1\1\12\1\45\1\113\1\153\1\12\1\111\1\64\1\1\2\12\1\241\1\153\2"+ "\12\1\30\1\242\1\243\2\1\1\12\1\21\1\150\5\1\1\244\1\245\1\45\2\12\1\146\1"+ "\1\1\113\1\72\1\54\1\55\1\67\1\1\1\246\1\15\21\1\3\12\1\1\1\247\1\113\12\1"+ "\2\12\1\146\2\1\1\250\2\1\3\12\1\1\1\251\1\113\2\1\2\12\1\27\1\1\1\113\3\1"+ "\1\12\1\76\1\1\1\113\26\1\4\12\1\113\1\104\34\1\3\12\1\45\20\1\71\12\1\76"+ "\16\1\14\12\1\143\53\1\2\12\1\146\75\1\44\12\1\111\33\1\43\12\1\45\1\12\1"+ "\146\1\113\6\1\1\12\1\147\1\1\3\12\1\1\1\143\1\113\1\153\1\252\1\12\67\1\4"+ "\12\1\46\1\70\3\1\1\153\6\1\1\15\77\1\6\12\1\27\1\123\1\45\1\76\66\1\5\12"+ "\1\210\3\12\1\142\1\253\1\254\1\255\3\12\1\256\1\257\1\12\1\260\1\261\1\35"+ "\24\12\1\262\1\12\1\35\1\132\1\12\1\132\1\12\1\210\1\12\1\210\1\146\1\12\1"+ "\146\1\12\1\55\1\12\1\55\1\12\1\263\3\264\14\12\1\46\123\1\1\255\1\12\1\265"+ "\1\266\1\267\1\270\1\271\1\272\1\273\1\150\1\274\1\150\24\1\55\12\1\111\2"+ "\1\103\12\1\46\15\12\1\147\150\12\1\15\25\1\41\12\1\147\36\1"); /* The ZZ_CMAP_A table has 3024 entries */ static final char ZZ_CMAP_A[] = zzUnpackCMap( "\10\0\2\61\1\76\1\0\1\61\1\76\22\0\1\14\1\74\1\0\1\75\1\16\1\0\1\71\1\64\1"+ "\2\1\3\1\20\1\21\1\56\1\13\1\1\1\0\1\53\3\55\4\54\2\47\1\70\1\0\1\63\1\73"+ "\1\72\1\17\1\0\2\30\1\37\1\35\1\45\1\46\1\31\1\57\1\40\2\66\1\44\1\67\1\60"+ "\1\66\1\42\1\50\1\65\1\34\1\66\1\43\3\33\1\66\1\32\1\6\1\10\1\7\1\23\1\12"+ "\1\0\1\25\1\26\1\36\1\35\2\25\1\27\1\57\1\40\1\66\1\62\1\43\1\66\1\24\1\66"+ "\1\41\1\66\1\24\1\33\1\24\1\52\2\33\1\51\1\66\1\31\1\4\1\22\1\5\14\0\1\11"+ "\12\0\1\11\4\0\1\11\5\0\27\11\1\0\12\11\4\0\14\11\16\0\5\11\7\0\1\11\1\0\1"+ "\11\1\0\5\11\1\0\2\11\2\0\4\11\1\0\1\11\6\0\1\11\1\0\3\11\1\0\1\11\1\0\4\11"+ "\1\0\23\11\1\0\13\11\10\0\6\11\1\0\26\11\2\0\1\11\6\0\10\11\10\0\13\11\5\0"+ "\3\11\15\0\12\15\4\0\6\11\1\0\1\11\17\0\2\11\7\0\2\11\12\15\3\11\2\0\2\11"+ "\1\0\16\11\15\0\11\11\13\0\1\11\16\0\12\15\6\11\4\0\2\11\4\0\1\11\5\0\6\11"+ "\4\0\1\11\11\0\1\11\3\0\1\11\7\0\11\11\7\0\5\11\17\0\26\11\3\0\1\11\2\0\1"+ "\11\7\0\12\11\4\0\12\15\1\11\4\0\10\11\2\0\2\11\2\0\26\11\1\0\7\11\1\0\1\11"+ "\3\0\4\11\3\0\1\11\20\0\1\11\15\0\2\11\1\0\1\11\5\0\6\11\4\0\2\11\1\0\2\11"+ "\1\0\2\11\1\0\2\11\17\0\4\11\1\0\1\11\7\0\12\15\2\0\3\11\20\0\11\11\1\0\2"+ "\11\1\0\2\11\1\0\5\11\3\0\1\11\2\0\1\11\30\0\1\11\13\0\10\11\2\0\1\11\3\0"+ "\1\11\1\0\6\11\3\0\3\11\1\0\4\11\3\0\2\11\1\0\1\11\1\0\2\11\3\0\2\11\3\0\3"+ "\11\3\0\14\11\13\0\10\11\1\0\2\11\10\0\3\11\5\0\4\11\1\0\5\11\3\0\1\11\3\0"+ "\2\11\15\0\13\11\2\0\1\11\21\0\1\11\12\0\6\11\5\0\22\11\3\0\10\11\1\0\11\11"+ "\1\0\1\11\2\0\7\11\11\0\1\11\1\0\2\11\14\0\12\15\7\0\2\11\1\0\1\11\2\0\2\11"+ "\1\0\1\11\2\0\1\11\6\0\4\11\1\0\7\11\1\0\3\11\1\0\1\11\1\0\1\11\2\0\2\11\1"+ "\0\4\11\1\0\2\11\11\0\1\11\2\0\5\11\1\0\1\11\11\0\12\15\2\0\14\11\1\0\24\11"+ "\13\0\5\11\3\0\6\11\4\0\4\11\3\0\1\11\3\0\2\11\7\0\3\11\4\0\15\11\14\0\1\11"+ "\1\0\6\11\1\0\1\11\5\0\1\11\2\0\13\11\1\0\15\11\1\0\4\11\2\0\7\11\1\0\1\11"+ "\1\0\4\11\2\0\1\11\1\0\4\11\2\0\7\11\1\0\1\11\1\0\4\11\2\0\16\11\2\0\6\11"+ "\2\0\15\11\2\0\1\11\1\0\10\11\7\0\15\11\1\0\6\11\23\0\1\11\4\0\1\11\3\0\11"+ "\11\1\0\1\11\5\0\17\11\1\0\16\11\2\0\14\11\13\0\1\11\15\0\7\11\7\0\16\11\15"+ "\0\2\11\12\15\3\0\3\11\11\0\4\11\1\0\4\11\3\0\2\11\11\0\10\11\1\0\1\11\1\0"+ "\1\11\1\0\1\11\1\0\6\11\1\0\7\11\1\0\1\11\3\0\3\11\1\0\7\11\3\0\4\11\2\0\6"+ "\11\5\0\1\11\15\0\1\11\2\0\1\11\4\0\1\11\2\0\12\11\1\0\1\11\3\0\5\11\6\0\1"+ "\11\1\0\1\11\1\0\1\11\1\0\4\11\1\0\13\11\2\0\4\11\5\0\5\11\4\0\1\11\4\0\2"+ "\11\13\0\5\11\6\0\4\11\3\0\2\11\14\0\10\11\7\0\10\11\1\0\7\11\6\0\2\11\12"+ "\0\5\11\5\0\2\11\3\0\7\11\6\0\3\11\12\15\2\11\13\0\11\11\2\0\27\11\2\0\7\11"+ "\1\0\3\11\1\0\4\11\1\0\4\11\2\0\6\11\3\0\1\11\1\0\1\11\2\0\5\11\1\0\12\11"+ "\12\15\5\11\1\0\3\11\1\0\10\11\4\0\7\11\3\0\1\11\3\0\2\11\1\0\1\11\3\0\2\11"+ "\2\0\5\11\2\0\1\11\1\0\1\11\30\0\3\11\3\0\6\11\2\0\6\11\2\0\6\11\11\0\7\11"+ "\4\0\5\11\3\0\5\11\5\0\1\11\1\0\10\11\1\0\5\11\1\0\1\11\1\0\2\11\1\0\2\11"+ "\1\0\12\11\6\0\12\11\2\0\6\11\2\0\6\11\2\0\6\11\2\0\3\11\3\0\14\11\1\0\16"+ "\11\1\0\2\11\1\0\2\11\1\0\10\11\6\0\4\11\4\0\16\11\2\0\1\11\1\0\14\11\1\0"+ "\2\11\3\0\1\11\2\0\4\11\1\0\2\11\12\0\10\11\6\0\6\11\1\0\3\11\1\0\12\11\3"+ "\0\1\11\12\0\4\11\13\0\12\15\1\11\1\0\1\11\3\0\7\11\1\0\1\11\1\0\4\11\1\0"+ "\17\11\1\0\2\11\14\0\3\11\4\0\2\11\1\0\1\11\20\0\4\11\10\0\1\11\13\0\10\11"+ "\5\0\3\11\2\0\1\11\2\0\2\11\2\0\4\11\1\0\14\11\1\0\1\11\1\0\7\11\1\0\21\11"+ "\1\0\4\11\2\0\10\11\1\0\7\11\1\0\14\11\1\0\4\11\1\0\5\11\1\0\1\11\3\0\14\11"+ "\2\0\13\11\1\0\10\11\2\0\22\15\1\0\2\11\1\0\1\11\2\0\1\11\1\0\12\11\1\0\4"+ "\11\1\0\1\11\1\0\1\11\6\0\1\11\4\0\1\11\1\0\1\11\1\0\1\11\1\0\3\11\1\0\2\11"+ "\1\0\1\11\2\0\1\11\1\0\1\11\1\0\1\11\1\0\1\11\1\0\1\11\1\0\2\11\1\0\1\11\2"+ "\0\4\11\1\0\7\11\1\0\4\11\1\0\4\11\1\0\1\11\1\0\12\11\1\0\5\11\1\0\3\11\1"+ "\0\5\11\1\0\5\11"); /** * Translates DFA states to action switch labels. */ private static final int [] ZZ_ACTION = zzUnpackAction(); private static final String ZZ_ACTION_PACKED_0 = "\13\0\1\1\6\0\1\2\1\3\1\4\1\5\1\6"+ "\1\7\1\10\1\11\1\12\1\13\1\14\1\15\1\16"+ "\1\17\1\20\1\21\1\22\1\23\1\2\1\24\1\25"+ "\1\26\1\27\1\30\1\31\2\32\1\33\1\34\1\35"+ "\1\33\1\36\1\37\1\40\1\12\1\41\1\2\1\42"+ "\1\12\1\43\1\44\1\45\1\46\1\47\1\50\1\1"+ "\1\26\1\51\1\52\2\53\1\54\1\55\2\0\1\56"+ "\1\57\1\60\1\61\1\62\1\63\1\64\1\65\1\66"+ "\1\12\1\66\1\67\2\70\1\71\1\72\1\12\1\73"+ "\1\74\1\75\1\76\1\77\1\100\1\101\1\12\1\102"+ "\1\103\1\104\1\105\1\106\1\107\1\110\1\111\1\112"+ "\1\113\2\54\1\114\1\0\1\115\1\116\1\117\1\120"+ "\1\121\1\122\1\0\1\123\1\0\1\124\4\0\1\125"+ "\1\126\1\127\1\73\1\130\1\131\1\132\1\133\2\134"+ "\1\135\1\136\1\137\1\140\1\141\1\142\1\143\1\0"+ "\1\144\1\145\1\0\1\146\2\0\1\73\1\147\1\133"+ "\2\134\1\150\1\151\1\133\1\152\1\153"; private static int [] zzUnpackAction() { int [] result = new int[160]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; } private static int zzUnpackAction(String packed, int offset, int [] result) { int i = 0; /* index in packed string */ int j = offset; /* index in unpacked array */ int l = packed.length(); while (i < l) { int count = packed.charAt(i++); int value = packed.charAt(i++); do result[j++] = value; while (--count > 0); } return j; } /** * Translates a state to a row index in the transition table */ private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); private static final String ZZ_ROWMAP_PACKED_0 = "\0\0\0\77\0\176\0\275\0\374\0\u013b\0\u017a\0\u01b9"+ "\0\u01f8\0\u0237\0\u0276\0\u02b5\0\u02f4\0\u0333\0\u0372\0\u03b1"+ "\0\u03f0\0\u042f\0\u046e\0\u046e\0\u04ad\0\u046e\0\u04ec\0\u046e"+ "\0\u052b\0\u046e\0\u056a\0\u046e\0\u046e\0\u046e\0\u046e\0\u046e"+ "\0\u046e\0\u046e\0\u046e\0\u046e\0\u05a9\0\u046e\0\u046e\0\u05e8"+ "\0\u0627\0\u046e\0\u046e\0\u046e\0\u05a9\0\u046e\0\u0666\0\u046e"+ "\0\u06a5\0\u046e\0\u06e4\0\u046e\0\u0723\0\u046e\0\u0762\0\u046e"+ "\0\u07a1\0\u046e\0\u046e\0\u046e\0\u07e0\0\u081f\0\u046e\0\u046e"+ "\0\u085e\0\u046e\0\u046e\0\u046e\0\u089d\0\u08dc\0\u091b\0\u095a"+ "\0\u0999\0\u046e\0\u046e\0\u046e\0\u09d8\0\u046e\0\u046e\0\u046e"+ "\0\u046e\0\u0a17\0\u0a56\0\u046e\0\u046e\0\u0a95\0\u046e\0\u046e"+ "\0\u046e\0\u046e\0\u0ad4\0\u046e\0\u0b13\0\u0b52\0\u0b91\0\u046e"+ "\0\u046e\0\u0bd0\0\u046e\0\u046e\0\u046e\0\u046e\0\u046e\0\u046e"+ "\0\u046e\0\u046e\0\u046e\0\u046e\0\u046e\0\u0c0f\0\u046e\0\u0c4e"+ "\0\u0c8d\0\u046e\0\u046e\0\u046e\0\u046e\0\u046e\0\u0ccc\0\u046e"+ "\0\u0d0b\0\u046e\0\u0d4a\0\u0d89\0\u0dc8\0\u0e07\0\u046e\0\u046e"+ "\0\u046e\0\u0e46\0\u046e\0\u0e85\0\u046e\0\u0ec4\0\u0f03\0\u0f42"+ "\0\u046e\0\u046e\0\u046e\0\u046e\0\u046e\0\u046e\0\u046e\0\u0f81"+ "\0\u046e\0\u046e\0\u0fc0\0\u046e\0\u0fff\0\u103e\0\u046e\0\u046e"+ "\0\u107d\0\u10bc\0\u046e\0\u046e\0\u046e\0\u10fb\0\u046e\0\u046e"; private static int [] zzUnpackRowMap() { int [] result = new int[160]; int offset = 0; offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); return result; } private static int zzUnpackRowMap(String packed, int offset, int [] result) { int i = 0; /* index in packed string */ int j = offset; /* index in unpacked array */ int l = packed.length(); while (i < l) { int high = packed.charAt(i++) << 16; result[j++] = high | packed.charAt(i++); } return j; } /** * The transition table of the DFA */ private static final int [] ZZ_TRANS = zzUnpackTrans(); private static final String ZZ_TRANS_PACKED_0 = "\1\23\1\24\1\25\1\26\1\27\1\30\1\31\1\32"+ "\1\33\3\23\1\34\1\23\1\35\1\36\1\37\1\40"+ "\1\41\1\42\35\23\1\43\13\23\1\44\1\43\10\23"+ "\1\45\66\23\5\46\1\47\3\46\1\50\11\46\1\42"+ "\23\50\1\46\3\50\4\46\2\50\1\46\1\50\2\46"+ "\3\50\14\46\1\47\7\46\1\51\31\46\1\51\3\46"+ "\3\51\1\52\20\46\23\0\1\53\53\0\10\54\1\55"+ "\66\54\6\56\1\57\1\60\1\61\3\56\1\62\44\56"+ "\1\62\14\56\1\62\6\23\1\63\1\64\1\65\2\23"+ "\1\66\1\34\44\23\1\43\7\23\1\67\4\23\1\43"+ "\4\46\1\70\3\46\1\71\21\46\1\72\1\46\1\72"+ "\2\46\1\72\2\46\1\72\1\46\1\72\13\46\1\72"+ "\6\46\1\72\13\46\1\70\3\46\1\71\66\46\3\73"+ "\1\74\5\73\1\75\1\73\1\76\10\73\23\75\1\73"+ "\3\75\4\73\2\75\1\73\1\75\2\73\3\75\1\77"+ "\6\73\76\14\1\100\11\73\1\101\12\73\23\101\1\73"+ "\3\101\4\73\2\101\1\73\1\101\2\73\3\101\2\73"+ "\1\102\15\73\1\101\12\73\23\101\1\73\3\101\4\73"+ "\2\101\1\73\1\101\1\73\1\103\3\101\12\73\1\74"+ "\5\73\1\101\12\73\23\101\1\73\3\101\4\73\2\101"+ "\1\73\1\101\2\73\3\101\12\73\1\74\5\73\1\101"+ "\3\73\1\51\6\73\23\101\1\51\3\101\3\51\1\73"+ "\2\101\1\73\1\101\2\73\3\101\7\73\11\104\1\50"+ "\11\104\1\42\23\50\1\104\3\50\4\104\2\50\1\104"+ "\1\50\2\104\3\50\1\105\6\104\4\0\1\106\210\0"+ "\1\107\74\0\1\110\31\0\1\110\3\0\3\110\1\111"+ "\43\0\1\112\53\0\1\113\3\114\1\115\1\116\1\114"+ "\1\113\1\114\2\113\1\117\1\120\1\113\6\114\2\121"+ "\1\122\1\123\3\124\3\125\1\126\2\127\2\130\3\131"+ "\1\132\1\133\1\134\1\135\1\136\1\137\2\133\1\113"+ "\1\140\1\141\1\120\1\142\2\113\1\125\2\132\6\113"+ "\1\120\45\0\1\143\33\0\2\50\5\0\5\50\6\0"+ "\32\50\1\0\2\50\1\0\1\50\2\0\3\50\24\0"+ "\1\51\31\0\1\51\3\0\3\51\44\0\1\144\44\0"+ "\1\145\15\0\1\146\13\0\1\147\24\0\1\150\51\0"+ "\1\151\44\0\1\152\6\0\6\113\3\114\2\113\1\117"+ "\1\120\7\113\3\121\4\132\3\125\1\126\2\127\2\130"+ "\3\131\1\132\1\133\1\134\1\135\1\136\1\137\2\133"+ "\1\113\1\140\1\141\1\120\1\132\2\113\3\132\6\113"+ "\1\120\71\0\1\153\5\0\6\113\1\114\1\113\1\114"+ "\2\113\1\117\1\120\7\113\2\121\5\132\3\125\1\126"+ "\2\127\2\130\3\131\1\132\1\133\1\134\1\135\1\136"+ "\1\137\2\133\1\113\1\140\1\141\1\120\1\132\2\113"+ "\3\132\6\113\1\120\11\0\1\75\12\0\23\75\1\0"+ "\3\75\4\0\2\75\1\0\1\75\2\0\3\75\20\0"+ "\1\76\12\0\23\76\1\0\3\76\4\0\2\76\1\0"+ "\1\76\2\0\3\76\20\0\5\101\6\0\32\101\1\0"+ "\2\101\1\0\1\101\2\0\3\101\16\0\1\154\74\0"+ "\1\155\17\0\2\156\1\0\1\156\4\0\3\156\5\0"+ "\3\156\3\0\3\156\23\0\1\157\37\0\1\160\20\0"+ "\1\161\1\162\3\0\1\163\1\0\1\164\1\165\1\166"+ "\1\167\6\0\1\170\7\0\1\110\31\0\1\110\3\0"+ "\3\110\1\171\25\0\1\172\7\0\1\173\31\0\1\173"+ "\3\0\3\173\36\0\1\174\31\0\1\174\3\0\3\174"+ "\1\175\24\0\1\176\155\0\1\177\1\200\12\0\77\201"+ "\47\0\1\202\3\0\3\202\25\0\1\203\20\0\2\204"+ "\1\0\1\204\4\0\3\204\5\0\3\204\3\0\3\204"+ "\25\0\1\205\20\0\2\206\1\0\1\206\4\0\3\206"+ "\5\0\3\206\3\0\3\206\74\0\1\207\1\210\1\207"+ "\104\0\1\211\1\212\17\0\1\213\17\0\2\156\1\0"+ "\1\156\4\0\3\156\5\0\3\156\3\0\3\156\104\0"+ "\1\214\7\0\1\215\76\0\1\216\1\217\2\0\3\220"+ "\1\0\73\220\5\0\1\170\7\0\1\171\31\0\1\171"+ "\3\0\3\171\26\0\1\221\7\0\1\173\31\0\1\173"+ "\3\0\3\173\26\0\1\222\7\0\1\174\31\0\1\174"+ "\3\0\3\174\1\223\25\0\1\224\7\0\1\225\31\0"+ "\1\225\3\0\3\225\50\0\1\226\116\0\1\227\3\0"+ "\3\227\46\0\2\230\1\0\1\230\4\0\3\230\5\0"+ "\3\230\3\0\3\230\46\0\2\231\1\0\1\231\4\0"+ "\3\231\5\0\3\231\3\0\3\231\74\0\3\232\74\0"+ "\3\233\21\0\3\220\1\234\73\220\5\0\1\222\7\0"+ "\1\223\31\0\1\223\3\0\3\223\26\0\1\235\7\0"+ "\1\225\31\0\1\225\3\0\3\225\26\0\1\124\116\0"+ "\2\236\1\0\1\236\4\0\3\236\5\0\3\236\3\0"+ "\3\236\74\0\3\237\46\0\2\240\1\0\1\240\4\0"+ "\3\240\5\0\3\240\3\0\3\240\21\0"; private static int [] zzUnpackTrans() { int [] result = new int[4410]; int offset = 0; offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); return result; } private static int zzUnpackTrans(String packed, int offset, int [] result) { int i = 0; /* index in packed string */ int j = offset; /* index in unpacked array */ int l = packed.length(); while (i < l) { int count = packed.charAt(i++); int value = packed.charAt(i++); value--; do result[j++] = value; while (--count > 0); } return j; } /* error codes */ private static final int ZZ_UNKNOWN_ERROR = 0; private static final int ZZ_NO_MATCH = 1; private static final int ZZ_PUSHBACK_2BIG = 2; /* error messages for the codes above */ private static final String[] ZZ_ERROR_MSG = { "Unknown internal scanner error", "Error: could not match input", "Error: pushback value was too large" }; /** * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code> */ private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); private static final String ZZ_ATTRIBUTE_PACKED_0 = "\13\0\1\1\6\0\2\11\1\1\1\11\1\1\1\11"+ "\1\1\1\11\1\1\11\11\1\1\2\11\2\1\3\11"+ "\1\1\1\11\1\1\1\11\1\1\1\11\1\1\1\11"+ "\1\1\1\11\1\1\1\11\1\1\3\11\2\1\2\11"+ "\1\1\3\11\3\1\2\0\3\11\1\1\4\11\2\1"+ "\2\11\1\1\4\11\1\1\1\11\3\1\2\11\1\1"+ "\13\11\1\1\1\11\1\0\1\1\5\11\1\0\1\11"+ "\1\0\1\11\4\0\3\11\1\1\1\11\1\1\1\11"+ "\3\1\7\11\1\0\2\11\1\0\1\11\2\0\2\11"+ "\2\1\3\11\1\1\2\11"; private static int [] zzUnpackAttribute() { int [] result = new int[160]; int offset = 0; offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); return result; } private static int zzUnpackAttribute(String packed, int offset, int [] result) { int i = 0; /* index in packed string */ int j = offset; /* index in unpacked array */ int l = packed.length(); while (i < l) { int count = packed.charAt(i++); int value = packed.charAt(i++); do result[j++] = value; while (--count > 0); } return j; } /** the input device */ private java.io.Reader zzReader; /** the current state of the DFA */ private int zzState; /** the current lexical state */ private int zzLexicalState = YYINITIAL; /** this buffer contains the current text to be matched and is the source of the yytext() string */ private CharSequence zzBuffer = ""; /** the textposition at the last accepting state */ private int zzMarkedPos; /** the current text position in the buffer */ private int zzCurrentPos; /** startRead marks the beginning of the yytext() string in the buffer */ private int zzStartRead; /** endRead marks the last character in the buffer, that has been read from input */ private int zzEndRead; /** * zzAtBOL == true <=> the scanner is currently at the beginning of a line */ private boolean zzAtBOL = true; /** zzAtEOF == true <=> the scanner is at the EOF */ private boolean zzAtEOF; /** denotes if the user-EOF-code has already been executed */ private boolean zzEOFDone; /* user code: */ // This adds support for nested states. I'm no JFlex pro, so maybe this is overkill, but it works quite well. final IntArrayList states = new IntArrayList(); // This was an idea to use the regex implementation for XML schema regexes (which use a slightly different syntax) // as well, but is currently unfinished as it requires to tweak more places than just the lexer. private boolean xmlSchemaMode; int capturingGroupCount = 0; private Boolean allowDanglingMetacharacters; private boolean allowOmitNumbersInQuantifiers; private boolean allowOmitBothNumbersInQuantifiers; private boolean allowNestedCharacterClasses; private boolean allowOctalNoLeadingZero; private boolean allowHexDigitClass; private boolean allowEmptyCharacterClass; private boolean allowHorizontalWhitespaceClass; private boolean allowPosixBracketExpressions; private boolean allowTransformationEscapes; private boolean allowExtendedUnicodeCharacter; private boolean allowOneHexCharEscape; private int maxOctal = 0777; private int minOctalDigits = 1; _RegExLexer(EnumSet<RegExpCapability> capabilities) { this((java.io.Reader)null); this.xmlSchemaMode = capabilities.contains(XML_SCHEMA_MODE); if (capabilities.contains(DANGLING_METACHARACTERS)) this.allowDanglingMetacharacters = Boolean.TRUE; if (capabilities.contains(NO_DANGLING_METACHARACTERS)) this.allowDanglingMetacharacters = Boolean.FALSE; this.allowOmitNumbersInQuantifiers = capabilities.contains(OMIT_NUMBERS_IN_QUANTIFIERS); this.allowOmitBothNumbersInQuantifiers = capabilities.contains(OMIT_BOTH_NUMBERS_IN_QUANTIFIERS); this.allowNestedCharacterClasses = capabilities.contains(NESTED_CHARACTER_CLASSES); this.allowOctalNoLeadingZero = capabilities.contains(OCTAL_NO_LEADING_ZERO); this.commentMode = capabilities.contains(COMMENT_MODE); this.allowHexDigitClass = capabilities.contains(ALLOW_HEX_DIGIT_CLASS); this.allowHorizontalWhitespaceClass = capabilities.contains(ALLOW_HORIZONTAL_WHITESPACE_CLASS); this.allowEmptyCharacterClass = capabilities.contains(ALLOW_EMPTY_CHARACTER_CLASS); this.allowPosixBracketExpressions = capabilities.contains(POSIX_BRACKET_EXPRESSIONS); this.allowTransformationEscapes = capabilities.contains(TRANSFORMATION_ESCAPES); if (capabilities.contains(MAX_OCTAL_177)) { maxOctal = 0177; } else if (capabilities.contains(MAX_OCTAL_377)) { maxOctal = 0377; } if (capabilities.contains(MIN_OCTAL_2_DIGITS)) { minOctalDigits = 2; } else if (capabilities.contains(MIN_OCTAL_3_DIGITS)) { minOctalDigits = 3; } this.allowExtendedUnicodeCharacter = capabilities.contains(EXTENDED_UNICODE_CHARACTER); this.allowOneHexCharEscape = capabilities.contains(ONE_HEX_CHAR_ESCAPE); } private void yypushstate(int state) { states.add(yystate()); yybegin(state); } private void yypopstate() { final int state = states.remove(states.size() - 1); yybegin(state); } private void handleOptions() { final String o = yytext().toString(); if (o.contains("x")) { commentMode = !o.startsWith("-"); } } // tracks whether the lexer is in comment mode, i.e. whether whitespace is not significant and whether to ignore // text after '#' till EOL boolean commentMode = false; /** * Creates a new scanner * * @param in the java.io.Reader to read input from. */ _RegExLexer(java.io.Reader in) { this.zzReader = in; } /** * Unpacks the compressed character translation table. * * @param packed the packed character translation table * @return the unpacked character translation table */ private static char [] zzUnpackCMap(String packed) { int size = 0; for (int i = 0, length = packed.length(); i < length; i += 2) { size += packed.charAt(i); } char[] map = new char[size]; int i = 0; /* index in packed string */ int j = 0; /* index in unpacked array */ while (i < packed.length()) { int count = packed.charAt(i++); char value = packed.charAt(i++); do map[j++] = value; while (--count > 0); } return map; } public final int getTokenStart() { return zzStartRead; } public final int getTokenEnd() { return getTokenStart() + yylength(); } public void reset(CharSequence buffer, int start, int end, int initialState) { zzBuffer = buffer; zzCurrentPos = zzMarkedPos = zzStartRead = start; zzAtEOF = false; zzAtBOL = true; zzEndRead = end; yybegin(initialState); } /** * Refills the input buffer. * * @return <code>false</code>, iff there was new input. * * @exception java.io.IOException if any I/O-Error occurs */ private boolean zzRefill() throws java.io.IOException { return true; } /** * Returns the current lexical state. */ public final int yystate() { return zzLexicalState; } /** * Enters a new lexical state * * @param newState the new lexical state */ public final void yybegin(int newState) { zzLexicalState = newState; } /** * Returns the text matched by the current regular expression. */ public final CharSequence yytext() { return zzBuffer.subSequence(zzStartRead, zzMarkedPos); } /** * Returns the character at position <tt>pos</tt> from the * matched text. * * It is equivalent to yytext().charAt(pos), but faster * * @param pos the position of the character to fetch. * A value from 0 to yylength()-1. * * @return the character at position pos */ public final char yycharat(int pos) { return zzBuffer.charAt(zzStartRead+pos); } /** * Returns the length of the matched text region. */ public final int yylength() { return zzMarkedPos-zzStartRead; } /** * Reports an error that occured while scanning. * * In a wellformed scanner (no or only correct usage of * yypushback(int) and a match-all fallback rule) this method * will only be called with things that "Can't Possibly Happen". * If this method is called, something is seriously wrong * (e.g. a JFlex bug producing a faulty scanner etc.). * * Usual syntax/scanner level error handling should be done * in error fallback rules. * * @param errorCode the code of the errormessage to display */ private void zzScanError(int errorCode) { String message; try { message = ZZ_ERROR_MSG[errorCode]; } catch (ArrayIndexOutOfBoundsException e) { message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; } throw new Error(message); } /** * Pushes the specified amount of characters back into the input stream. * * They will be read again by then next call of the scanning method * * @param number the number of characters to be read again. * This number must not be greater than yylength()! */ public void yypushback(int number) { if ( number > yylength() ) zzScanError(ZZ_PUSHBACK_2BIG); zzMarkedPos -= number; } /** * Resumes scanning until the next regular expression is matched, * the end of input is encountered or an I/O-Error occurs. * * @return the next token * @exception java.io.IOException if any I/O-Error occurs */ public IElementType advance() throws java.io.IOException { int zzInput; int zzAction; // cached fields: int zzCurrentPosL; int zzMarkedPosL; int zzEndReadL = zzEndRead; CharSequence zzBufferL = zzBuffer; int [] zzTransL = ZZ_TRANS; int [] zzRowMapL = ZZ_ROWMAP; int [] zzAttrL = ZZ_ATTRIBUTE; while (true) { zzMarkedPosL = zzMarkedPos; zzAction = -1; zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; zzState = ZZ_LEXSTATE[zzLexicalState]; // set up zzAction for empty match case: int zzAttributes = zzAttrL[zzState]; if ( (zzAttributes & 1) == 1 ) { zzAction = zzState; } zzForAction: { while (true) { if (zzCurrentPosL < zzEndReadL) { zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL/*, zzEndReadL*/); zzCurrentPosL += Character.charCount(zzInput); } else if (zzAtEOF) { zzInput = YYEOF; break zzForAction; } else { // store back cached positions zzCurrentPos = zzCurrentPosL; zzMarkedPos = zzMarkedPosL; boolean eof = zzRefill(); // get translated positions and possibly new buffer zzCurrentPosL = zzCurrentPos; zzMarkedPosL = zzMarkedPos; zzBufferL = zzBuffer; zzEndReadL = zzEndRead; if (eof) { zzInput = YYEOF; break zzForAction; } else { zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL/*, zzEndReadL*/); zzCurrentPosL += Character.charCount(zzInput); } } int zzNext = zzTransL[ zzRowMapL[zzState] + ZZ_CMAP(zzInput) ]; if (zzNext == -1) break zzForAction; zzState = zzNext; zzAttributes = zzAttrL[zzState]; if ( (zzAttributes & 1) == 1 ) { zzAction = zzState; zzMarkedPosL = zzCurrentPosL; if ( (zzAttributes & 8) == 8 ) break zzForAction; } } } // store back cached position zzMarkedPos = zzMarkedPosL; if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { zzAtEOF = true; return null; } else { switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { case 1: { yypopstate(); return RegExpTT.COMMENT; } case 108: break; case 2: { return RegExpTT.CHARACTER; } case 109: break; case 3: { return RegExpTT.DOT; } case 110: break; case 4: { capturingGroupCount++; return RegExpTT.GROUP_BEGIN; } case 111: break; case 5: { return RegExpTT.GROUP_END; } case 112: break; case 6: { if (allowDanglingMetacharacters != Boolean.TRUE) { yypushstate(QUANTIFIER); return RegExpTT.LBRACE; } return RegExpTT.CHARACTER; } case 113: break; case 7: { return (allowDanglingMetacharacters != Boolean.FALSE) ? RegExpTT.CHARACTER : RegExpTT.RBRACE; } case 114: break; case 8: { yypushstate(CLASS1); return RegExpTT.CLASS_BEGIN; } case 115: break; case 9: { return allowDanglingMetacharacters == Boolean.FALSE ? RegExpTT.CLASS_END : RegExpTT.CHARACTER; } case 116: break; case 10: { return StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN; } case 117: break; case 11: { return commentMode ? com.intellij.psi.TokenType.WHITE_SPACE : RegExpTT.CHARACTER; } case 118: break; case 12: { return RegExpTT.DOLLAR; } case 119: break; case 13: { return RegExpTT.QUEST; } case 120: break; case 14: { return RegExpTT.STAR; } case 121: break; case 15: { return RegExpTT.PLUS; } case 122: break; case 16: { return RegExpTT.UNION; } case 123: break; case 17: { return RegExpTT.CARET; } case 124: break; case 18: { return commentMode ? com.intellij.psi.TokenType.WHITE_SPACE : RegExpTT.CTRL_CHARACTER; } case 125: break; case 19: { if (commentMode) { yypushstate(COMMENT); return RegExpTT.COMMENT; } else return RegExpTT.CHARACTER; } case 126: break; case 20: { yypopstate(); yypushback(1); } case 127: break; case 21: { yypopstate(); return RegExpTT.RBRACE; } case 128: break; case 22: { return RegExpTT.NAME; } case 129: break; case 23: { return RegExpTT.NUMBER; } case 130: break; case 24: { return RegExpTT.COMMA; } case 131: break; case 25: { yybegin(CLASS1); return RegExpTT.CARET; } case 132: break; case 26: { states.set(states.size() - 1, CLASS2); return RegExpTT.CHARACTER; } case 133: break; case 27: { yypushback(1); yybegin(CLASS2); } case 134: break; case 28: { yybegin(CLASS2); if (allowNestedCharacterClasses) { yypushstate(CLASS1); return RegExpTT.CLASS_BEGIN; } return RegExpTT.CHARACTER; } case 135: break; case 29: { if (allowEmptyCharacterClass) { yypopstate(); return RegExpTT.CLASS_END; } yybegin(CLASS2); return RegExpTT.CHARACTER; } case 136: break; case 30: { if (commentMode) return com.intellij.psi.TokenType.WHITE_SPACE; yypushback(1); yybegin(CLASS2); } case 137: break; case 31: { if (allowNestedCharacterClasses) { yypushstate(CLASS1); return RegExpTT.CLASS_BEGIN; } return RegExpTT.CHARACTER; } case 138: break; case 32: { yypopstate(); return RegExpTT.CLASS_END; } case 139: break; case 33: { return RegExpTT.MINUS; } case 140: break; case 34: { yypopstate(); yypushstate(EMBRACED); return RegExpTT.LBRACE; } case 141: break; case 35: { yypopstate(); return RegExpTT.CATEGORY_SHORT_HAND; } case 142: break; case 36: { yybegin(YYINITIAL); return RegExpTT.BAD_CHARACTER; } case 143: break; case 37: { yybegin(YYINITIAL); return RegExpTT.GROUP_END; } case 144: break; case 38: { handleOptions(); return RegExpTT.OPTIONS_ON; } case 145: break; case 39: { handleOptions(); return RegExpTT.OPTIONS_OFF; } case 146: break; case 40: { yybegin(YYINITIAL); return RegExpTT.COLON; } case 147: break; case 41: { yybegin(YYINITIAL); return RegExpTT.GT; } case 148: break; case 42: { yybegin(YYINITIAL); return RegExpTT.QUOTE; } case 149: break; case 43: { return RegExpTT.BAD_CHARACTER; } case 150: break; case 44: { yypopstate(); return (yycharat(-1) == 'u') ? StringEscapesTokenTypes.INVALID_UNICODE_ESCAPE_TOKEN : RegExpTT.BAD_HEX_VALUE; } case 151: break; case 45: { yybegin(OPTIONS); return RegExpTT.SET_OPTIONS; } case 152: break; case 46: // lookahead expression with fixed base length zzMarkedPos = Character.offsetByCodePoints (zzBufferL/*, zzStartRead, zzEndRead - zzStartRead*/, zzStartRead, 1); { yypushstate(NEGATED_CLASS); return RegExpTT.CLASS_BEGIN; } case 153: break; case 47: { return RegExpTT.REDUNDANT_ESCAPE; } case 154: break; case 48: { return RegExpTT.ESC_CHARACTER; } case 155: break; case 49: { return (allowDanglingMetacharacters != Boolean.TRUE) ? RegExpTT.ESC_CHARACTER : RegExpTT.REDUNDANT_ESCAPE; } case 156: break; case 50: { return (allowDanglingMetacharacters == Boolean.FALSE) ? RegExpTT.ESC_CHARACTER : RegExpTT.REDUNDANT_ESCAPE; } case 157: break; case 51: { return (yystate() == CLASS2) ? RegExpTT.ESC_CHARACTER : RegExpTT.REDUNDANT_ESCAPE; } case 158: break; case 52: { return commentMode ? RegExpTT.ESC_CTRL_CHARACTER : RegExpTT.REDUNDANT_ESCAPE; } case 159: break; case 53: { return RegExpTT.ESC_CTRL_CHARACTER; } case 160: break; case 54: { return RegExpTT.BOUNDARY; } case 161: break; case 55: { return RegExpTT.CHAR_CLASS; } case 162: break; case 56: { if (xmlSchemaMode) return RegExpTT.CHAR_CLASS; else return StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN; } case 163: break; case 57: { yypushstate(PROP); return RegExpTT.PROPERTY; } case 164: break; case 58: { return allowTransformationEscapes ? RegExpTT.CHAR_CLASS : StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN; } case 165: break; case 59: { String text = yytext().toString().substring(1); if (allowOctalNoLeadingZero) { if (Integer.parseInt(text) <= capturingGroupCount && yystate() != CLASS2) return RegExpTT.BACKREF; int i = 0; int value = 0; for (; i < text.length(); i++) { char c = text.charAt(i); if (c > '7') break; value = value * 8 + (c - '0'); } if (i > 0) { yypushback(text.length() - i); if (value > maxOctal) { yypushback(1); return RegExpTT.BAD_OCT_VALUE; } if (minOctalDigits > i && yystate() != CLASS2) { return RegExpTT.BAD_OCT_VALUE; } return RegExpTT.OCT_CHAR; } return StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN; } else { if (yystate() == CLASS2) { yypushback(yylength() - 2); return StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN; } /* java.util.regex.Pattern says about backrefs: "In this class, \1 through \9 are always interpreted as back references, and a larger number is accepted as a back reference if at least that many subexpressions exist at that point in the regular expression, otherwise the parser will drop digits until the number is smaller or equal to the existing number of groups or it is one digit." */ while (yylength() > 2 && Integer.parseInt(yytext().toString().substring(1)) > capturingGroupCount) { yypushback(1); } return RegExpTT.BACKREF; } } case 166: break; case 60: { yypushstate(QUOTED); return RegExpTT.QUOTE_BEGIN; } case 167: break; case 61: { return RegExpTT.BAD_HEX_VALUE; } case 168: break; case 62: { return allowTransformationEscapes ? RegExpTT.CHAR_CLASS : StringEscapesTokenTypes.INVALID_UNICODE_ESCAPE_TOKEN; } case 169: break; case 63: { return (allowOctalNoLeadingZero ? RegExpTT.OCT_CHAR : RegExpTT.BAD_OCT_VALUE); } case 170: break; case 64: { return (allowHexDigitClass || allowHorizontalWhitespaceClass ? RegExpTT.CHAR_CLASS : StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN); } case 171: break; case 65: { yypushstate(NAMED); return RegExpTT.NAMED_CHARACTER; } case 172: break; case 66: { yypopstate(); return RegExpTT.QUOTE_END; } case 173: break; case 67: // lookahead expression with fixed base length zzMarkedPos = Character.offsetByCodePoints (zzBufferL/*, zzStartRead, zzEndRead - zzStartRead*/, zzStartRead, 1); { yybegin(CLASS2); if (allowNestedCharacterClasses) { yypushstate(NEGATED_CLASS); return RegExpTT.CLASS_BEGIN; } return RegExpTT.CHARACTER; } case 174: break; case 68: // lookahead expression with fixed base length zzMarkedPos = Character.offsetByCodePoints (zzBufferL/*, zzStartRead, zzEndRead - zzStartRead*/, zzStartRead, 1); { yybegin(CLASS2); if (allowPosixBracketExpressions) { yypushback(1); } else if (allowNestedCharacterClasses) { yypushstate(CLASS1); return RegExpTT.CLASS_BEGIN; } else { return RegExpTT.CHARACTER; } } case 175: break; case 69: { yybegin(CLASS2); return allowEmptyCharacterClass ? RegExpTT.ESC_CHARACTER : RegExpTT.REDUNDANT_ESCAPE; } case 176: break; case 70: { yypushstate(CLASS2); return RegExpTT.ESC_CHARACTER; } case 177: break; case 71: { yypushstate(QUOTED_CLASS1); return RegExpTT.QUOTE_BEGIN; } case 178: break; case 72: // lookahead expression with fixed base length zzMarkedPos = Character.offsetByCodePoints (zzBufferL/*, zzStartRead, zzEndRead - zzStartRead*/, zzStartRead, 1); { if (allowNestedCharacterClasses) { yypushstate(NEGATED_CLASS); return RegExpTT.CLASS_BEGIN; } return RegExpTT.CHARACTER; } case 179: break; case 73: { if (allowPosixBracketExpressions) { yybegin(BRACKET_EXPRESSION); return RegExpTT.BRACKET_EXPRESSION_BEGIN; } else { yypushback(1); return allowNestedCharacterClasses ? RegExpTT.CLASS_BEGIN : RegExpTT.CHARACTER; } } case 180: break; case 74: { if (allowNestedCharacterClasses) return RegExpTT.ANDAND; else yypushback(1); return RegExpTT.CHARACTER; } case 181: break; case 75: { yybegin(CLASS2); return RegExpTT.BRACKET_EXPRESSION_END; } case 182: break; case 76: { yybegin(PY_COND_REF); return RegExpTT.PYTHON_COND_REF; } case 183: break; case 77: { yybegin(NAMED_GROUP); capturingGroupCount++; return RegExpTT.RUBY_NAMED_GROUP; } case 184: break; case 78: { yybegin(QUOTED_NAMED_GROUP); capturingGroupCount++; return RegExpTT.RUBY_QUOTED_NAMED_GROUP; } case 185: break; case 79: { return RegExpTT.NON_CAPT_GROUP; } case 186: break; case 80: { return RegExpTT.ATOMIC_GROUP; } case 187: break; case 81: { return RegExpTT.POS_LOOKAHEAD; } case 188: break; case 82: { return RegExpTT.NEG_LOOKAHEAD; } case 189: break; case 83: // lookahead expression with fixed base length zzMarkedPos = Character.offsetByCodePoints (zzBufferL/*, zzStartRead, zzEndRead - zzStartRead*/, zzStartRead, 1); { yypushstate(QUANTIFIER); return RegExpTT.LBRACE; } case 190: break; case 84: // lookahead expression with fixed base length zzMarkedPos = Character.offsetByCodePoints (zzBufferL/*, zzStartRead, zzEndRead - zzStartRead*/, zzStartRead, 1); { if (allowOmitBothNumbersInQuantifiers || allowDanglingMetacharacters != Boolean.TRUE) { yypushstate(QUANTIFIER); return RegExpTT.LBRACE; } else return RegExpTT.CHARACTER; } case 191: break; case 85: { yybegin(NAMED_GROUP); return RegExpTT.RUBY_NAMED_GROUP_CALL; } case 192: break; case 86: { yybegin(QUOTED_NAMED_GROUP); return RegExpTT.RUBY_QUOTED_NAMED_GROUP_CALL; } case 193: break; case 87: { if (xmlSchemaMode) { yypushback(1); return RegExpTT.CHAR_CLASS; } else return RegExpTT.CTRL; } case 194: break; case 88: // lookahead expression with fixed base length zzMarkedPos = Character.offsetByCodePoints (zzBufferL/*, zzStartRead, zzEndRead - zzStartRead*/, zzStartRead, 2); { if (allowExtendedUnicodeCharacter) yypushstate(EMBRACED_HEX); else return RegExpTT.BAD_HEX_VALUE; } case 195: break; case 89: { if (allowOneHexCharEscape) { return RegExpTT.HEX_CHAR; } else { yypushback(1); return RegExpTT.BAD_HEX_VALUE; } } case 196: break; case 90: // lookahead expression with fixed base length zzMarkedPos = Character.offsetByCodePoints (zzBufferL/*, zzStartRead, zzEndRead - zzStartRead*/, zzStartRead, 2); { if (allowExtendedUnicodeCharacter) yypushstate(EMBRACED_HEX); else return StringEscapesTokenTypes.INVALID_UNICODE_ESCAPE_TOKEN; } case 197: break; case 91: { yypushback(yylength() - 2); return StringEscapesTokenTypes.INVALID_UNICODE_ESCAPE_TOKEN; } case 198: break; case 92: { return RegExpTT.OCT_CHAR; } case 199: break; case 93: { yybegin(NAMED_GROUP); return RegExpTT.RUBY_NAMED_GROUP_REF; } case 200: break; case 94: { yybegin(QUOTED_NAMED_GROUP); return RegExpTT.RUBY_QUOTED_NAMED_GROUP_REF; } case 201: break; case 95: { yypopstate(); return (yycharat(-1) == 'u') ? RegExpTT.UNICODE_CHAR : RegExpTT.HEX_CHAR; } case 202: break; case 96: { yybegin(NAMED_GROUP); capturingGroupCount++; return RegExpTT.PYTHON_NAMED_GROUP; } case 203: break; case 97: { yybegin(PY_NAMED_GROUP_REF); return RegExpTT.PYTHON_NAMED_GROUP_REF; } case 204: break; case 98: { return RegExpTT.POS_LOOKBEHIND; } case 205: break; case 99: { return RegExpTT.NEG_LOOKBEHIND; } case 206: break; case 100: // lookahead expression with fixed base length zzMarkedPos = Character.offsetByCodePoints (zzBufferL/*, zzStartRead, zzEndRead - zzStartRead*/, zzStartRead, 1); { if (allowOmitNumbersInQuantifiers || allowDanglingMetacharacters != Boolean.TRUE) { yypushstate(QUANTIFIER); return RegExpTT.LBRACE; } else return RegExpTT.CHARACTER; } case 207: break; case 101: // lookahead expression with fixed base length zzMarkedPos = Character.offsetByCodePoints (zzBufferL/*, zzStartRead, zzEndRead - zzStartRead*/, zzStartRead, 2); { return RegExpTT.ESC_CHARACTER; } case 208: break; case 102: // lookahead expression with fixed base length zzMarkedPos = Character.offsetByCodePoints (zzBufferL/*, zzStartRead, zzEndRead - zzStartRead*/, zzStartRead, 2); { return allowOmitBothNumbersInQuantifiers ? RegExpTT.ESC_CHARACTER : RegExpTT.REDUNDANT_ESCAPE; } case 209: break; case 103: { return RegExpTT.HEX_CHAR; } case 210: break; case 104: { return RegExpTT.COMMENT; } case 211: break; case 105: // lookahead expression with fixed base length zzMarkedPos = Character.offsetByCodePoints (zzBufferL/*, zzStartRead, zzEndRead - zzStartRead*/, zzStartRead, 2); { return allowOmitNumbersInQuantifiers ? RegExpTT.ESC_CHARACTER : RegExpTT.REDUNDANT_ESCAPE; } case 212: break; case 106: { if (allowOctalNoLeadingZero) yypushback(1); return RegExpTT.OCT_CHAR; } case 213: break; case 107: { return RegExpTT.UNICODE_CHAR; } case 214: break; default: zzScanError(ZZ_NO_MATCH); } } } } }