/* The following code was generated by JFlex 1.7.0-SNAPSHOT tweaked for IntelliJ platform */ package org.jetbrains.yaml.lexer; import com.intellij.lexer.FlexLexer; import com.intellij.psi.tree.IElementType; import org.jetbrains.yaml.YAMLTokenTypes; /* Auto generated File */ /** * This class is a scanner generated by * <a href="http://www.jflex.de/">JFlex</a> 1.7.0-SNAPSHOT * from the specification file <tt>yaml.flex</tt> */ public class _YAMLLexer implements FlexLexer, YAMLTokenTypes { /** 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 BRACES = 2; public static final int VALUE = 4; public static final int VALUE_OR_KEY = 6; public static final int VALUE_BRACE = 8; public static final int INDENT_VALUE = 10; /** * 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, 0, 0, 3, 3, 4, 4 }; /** * Translates characters to character classes * Chosen bits are [9, 6, 6] * Total runtime size is 3360 bytes */ public static int ZZ_CMAP(int ch) { return ZZ_CMAP_A[(ZZ_CMAP_Y[(ZZ_CMAP_Z[ch>>12]<<6)|((ch>>6)&0x3f)]<<6)|(ch&0x3f)]; } /* The ZZ_CMAP_Z table has 272 entries */ static final char ZZ_CMAP_Z[] = zzUnpackCMap( "\1\0\1\1\10\2\1\3\4\2\1\4\1\5\1\6\4\2\1\7\6\2\1\10\362\2"); /* The ZZ_CMAP_Y table has 576 entries */ static final char ZZ_CMAP_Y[] = zzUnpackCMap( "\1\0\1\1\27\2\1\3\1\2\1\4\3\2\1\5\5\2\1\6\1\2\1\6\1\2\1\6\1\2\1\6\1\2\1\6"+ "\1\2\1\6\1\2\1\6\1\2\1\6\1\2\1\6\1\2\1\6\1\2\1\7\1\2\1\7\1\3\4\2\1\5\1\7\34"+ "\2\1\3\1\7\4\2\1\10\1\2\1\7\2\2\1\11\2\2\1\7\1\4\2\2\1\11\146\2\1\3\12\2\1"+ "\7\1\5\2\2\1\12\1\2\1\7\5\2\1\4\114\2\1\7\25\2\1\3\56\2\1\6\1\2\1\4\1\13\2"+ "\2\1\7\3\2\1\4\7\2\1\7\5\2\1\7\1\2\1\5\1\4\6\2\1\3\105\2\1\3\3\2\1\7\61\2"+ "\1\14\40\2"); /* The ZZ_CMAP_A table has 832 entries */ static final char ZZ_CMAP_A[] = zzUnpackCMap( "\11\0\1\10\1\7\2\0\1\1\22\0\1\13\1\27\1\21\1\5\1\25\1\17\1\26\1\22\2\25\1"+ "\26\1\32\1\3\1\12\2\25\12\23\1\6\1\25\1\30\1\25\1\14\1\4\1\26\6\23\24\24\1"+ "\31\1\20\1\11\1\0\1\25\1\2\6\23\24\24\1\15\1\33\1\16\1\25\141\0\12\23\106"+ "\0\12\23\6\0\12\23\134\0\12\23\40\0\12\23\54\0\12\23\60\0\12\23\6\0\12\23"+ "\66\0\12\23\26\0\12\23\74\0\12\23\16\0\62\23"); /** * Translates DFA states to action switch labels. */ private static final int [] ZZ_ACTION = zzUnpackAction(); private static final String ZZ_ACTION_PACKED_0 = "\15\0\1\1\1\2\1\3\1\4\1\5\1\2\1\6"+ "\1\7\1\10\2\2\1\11\1\12\4\2\1\13\1\2"+ "\1\1\1\4\2\2\1\11\1\2\1\1\1\4\4\2"+ "\1\1\1\4\2\2\1\14\1\15\1\16\10\0\1\1"+ "\1\0\1\17\1\0\2\20\2\21\2\22\6\0\1\23"+ "\2\0\1\24\1\0\2\25\4\0\2\26\1\0\1\1"+ "\1\0\1\17\3\0\1\1\4\0\1\23\1\24\1\1"+ "\3\0\1\27\14\0\1\30\1\0\1\1\2\0\1\31"+ "\3\0\1\32\1\0\1\1\5\0\1\1\2\0\2\1"+ "\2\0\2\1\2\0\1\1\2\0\1\1\1\0\1\1"+ "\3\0\2\1\1\0\4\1\1\0\1\1\2\0\1\1"; private static int [] zzUnpackAction() { int [] result = new int[168]; 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\34\0\70\0\124\0\160\0\214\0\250\0\304"+ "\0\340\0\374\0\u0118\0\u0134\0\u0150\0\u016c\0\u0188\0\u0188"+ "\0\u01a4\0\u01c0\0\u01dc\0\u0188\0\u01f8\0\u0188\0\u0214\0\u0230"+ "\0\u024c\0\u0188\0\u0268\0\u0284\0\u02a0\0\u02bc\0\u0188\0\u02d8"+ "\0\u02f4\0\u0310\0\u032c\0\u0348\0\u0364\0\u0380\0\u039c\0\u03b8"+ "\0\u03d4\0\u03b8\0\u03f0\0\u040c\0\u0428\0\u0444\0\u0460\0\u0444"+ "\0\u047c\0\u0188\0\u0498\0\u04b4\0\u0188\0\u04d0\0\u04ec\0\u0508"+ "\0\u0524\0\u0540\0\u055c\0\u0578\0\u0594\0\u05b0\0\u016c\0\u0188"+ "\0\u05cc\0\u0188\0\u05e8\0\u0188\0\u0604\0\u0620\0\u063c\0\u0658"+ "\0\u0284\0\u03f0\0\u0674\0\u0690\0\u02a0\0\u040c\0\u06ac\0\u06c8"+ "\0\u0188\0\u06e4\0\u0700\0\u071c\0\u0738\0\u0754\0\u0188\0\u0770"+ "\0\u078c\0\u07a8\0\u07c4\0\u07e0\0\u02f4\0\u07fc\0\u0818\0\u0834"+ "\0\u0850\0\u03b8\0\u039c\0\u086c\0\u0188\0\u0888\0\u08a4\0\u08c0"+ "\0\u0444\0\u0428\0\u0188\0\u08dc\0\u08f8\0\u0914\0\u08dc\0\u0930"+ "\0\u094c\0\u0968\0\u0508\0\u0984\0\u09a0\0\u0540\0\u0188\0\u0188"+ "\0\u09bc\0\u09d8\0\u09f4\0\u0a10\0\u0188\0\u0a2c\0\u0a48\0\u0a64"+ "\0\u0188\0\u0a80\0\u0a9c\0\u0ab8\0\u0ad4\0\u0af0\0\u0b0c\0\u0b28"+ "\0\u0b44\0\u0b60\0\u0b7c\0\u0b98\0\u0bb4\0\u0bd0\0\u09d8\0\u0bec"+ "\0\u0c08\0\u0c24\0\u0c40\0\u0c5c\0\u0c78\0\u0c94\0\u0cb0\0\u0ccc"+ "\0\u0ce8\0\u0a9c\0\u0d04\0\u0d20\0\u0d3c\0\u0d58\0\u0b44\0\u0d74"+ "\0\u0d90\0\u0dac\0\u0dc8\0\u0de4\0\u0e00\0\u0c5c\0\u0e1c\0\u0e38"; private static int [] zzUnpackRowMap() { int [] result = new int[168]; 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\16\2\17\1\20\1\21\1\22\1\23\1\24\1\25"+ "\1\26\1\27\1\25\1\30\1\31\1\32\1\33\1\16"+ "\1\34\1\35\3\16\1\17\1\36\1\16\1\37\1\16"+ "\1\40\1\41\2\17\1\20\1\42\1\22\1\43\1\24"+ "\1\25\1\26\1\44\1\25\1\17\1\45\1\32\1\46"+ "\1\41\1\34\1\35\3\41\1\17\1\36\1\41\1\37"+ "\1\41\1\17\1\47\2\17\1\20\1\50\1\22\1\51"+ "\1\24\1\25\1\26\1\52\1\25\1\30\1\31\1\32"+ "\1\33\1\47\1\53\1\54\3\47\1\17\1\36\1\47"+ "\1\37\1\47\1\40\1\55\2\17\1\20\1\56\1\22"+ "\1\57\1\24\1\25\1\26\1\60\1\25\1\30\1\45"+ "\1\32\1\46\1\55\1\53\1\54\3\55\1\17\1\36"+ "\1\55\1\37\1\55\1\40\7\61\1\62\1\63\2\61"+ "\1\63\20\61\27\0\1\64\13\0\1\65\1\66\2\0"+ "\1\66\20\0\1\67\3\0\1\70\1\0\1\70\3\0"+ "\1\70\5\0\1\67\2\0\3\67\2\0\1\67\1\0"+ "\1\67\2\0\1\65\1\0\1\65\3\0\3\65\1\0"+ "\1\65\1\0\2\65\12\0\1\65\2\0\1\71\3\0"+ "\1\72\1\0\1\72\3\0\1\72\5\0\1\71\2\0"+ "\3\71\2\0\1\71\1\0\1\71\2\0\1\65\5\0"+ "\2\65\2\0\1\65\34\0\1\73\52\0\1\73\1\74"+ "\1\0\3\74\1\75\1\76\1\0\1\77\2\74\1\77"+ "\20\74\34\0\1\16\1\0\5\16\2\0\2\16\1\0"+ "\20\16\7\22\1\0\24\22\1\16\1\0\5\16\1\100"+ "\1\101\2\16\1\101\20\16\10\0\1\25\2\0\1\25"+ "\20\0\1\16\1\0\5\16\1\102\1\103\2\16\1\103"+ "\20\16\7\0\1\104\1\105\1\0\1\106\1\105\16\0"+ "\1\106\16\0\1\107\33\0\1\110\16\0\7\111\1\112"+ "\10\111\1\113\1\114\12\111\7\115\1\116\12\115\1\117"+ "\11\115\4\0\3\120\1\121\1\122\1\0\1\123\1\122"+ "\3\0\1\124\2\0\1\120\2\123\2\120\1\125\1\126"+ "\1\0\1\120\10\0\1\127\1\130\1\0\1\131\1\130"+ "\16\0\1\131\1\0\1\132\1\0\1\132\1\133\1\132"+ "\1\133\1\134\1\0\1\135\1\133\1\132\1\135\1\132"+ "\2\133\12\132\1\133\2\132\1\41\1\0\1\41\1\0"+ "\3\41\3\0\1\41\1\0\1\41\2\0\12\41\1\0"+ "\3\41\1\0\1\41\1\0\3\41\1\100\1\101\1\0"+ "\1\41\1\101\1\41\2\0\12\41\1\0\3\41\1\0"+ "\1\41\1\0\3\41\1\102\1\103\1\0\1\41\1\103"+ "\1\41\2\0\12\41\1\0\2\41\15\0\1\136\33\0"+ "\1\137\16\0\1\140\1\0\3\140\1\141\1\142\1\0"+ "\1\143\2\140\1\143\20\140\1\47\1\0\5\47\2\0"+ "\2\47\1\0\21\47\1\0\5\47\1\100\1\101\2\47"+ "\1\101\20\47\20\112\1\144\1\145\12\112\22\116\1\146"+ "\11\116\1\147\1\0\1\147\1\150\1\147\1\150\1\151"+ "\1\0\1\152\1\150\1\147\1\152\1\147\2\150\12\147"+ "\1\150\2\147\1\55\1\0\1\55\1\0\3\55\3\0"+ "\1\55\1\0\1\55\2\0\12\55\1\0\3\55\1\0"+ "\1\55\1\0\3\55\1\100\1\101\1\0\1\55\1\101"+ "\1\55\2\0\12\55\1\0\2\55\7\61\1\0\24\61"+ "\7\0\1\153\1\63\2\0\1\63\24\0\3\154\3\0"+ "\1\155\4\0\1\156\2\0\1\154\2\155\2\154\1\157"+ "\1\160\1\0\1\154\11\0\1\66\2\0\1\66\20\0"+ "\1\161\1\0\1\161\1\162\1\161\1\162\1\163\1\0"+ "\1\67\1\162\1\161\1\67\1\161\2\162\12\161\1\162"+ "\2\161\1\67\1\0\1\67\1\0\3\67\3\0\1\67"+ "\1\0\1\67\2\0\12\67\1\0\2\67\1\164\1\0"+ "\3\164\1\165\1\166\1\0\1\71\2\164\1\71\20\164"+ "\1\71\1\0\5\71\2\0\2\71\1\0\20\71\12\0"+ "\1\167\17\0\1\167\1\0\1\74\1\0\4\74\1\76"+ "\1\0\1\77\2\74\1\77\20\74\5\0\1\16\26\0"+ "\1\16\1\170\5\16\2\170\2\16\1\170\20\16\10\0"+ "\1\101\2\0\1\101\30\0\1\103\2\0\1\103\30\0"+ "\1\105\2\0\1\105\27\0\1\104\1\105\2\0\1\105"+ "\20\0\5\171\1\0\1\171\1\0\1\171\3\0\1\171"+ "\2\0\12\171\1\0\2\171\1\172\3\110\1\173\1\110"+ "\1\173\1\0\2\110\1\173\3\110\1\174\1\110\1\172"+ "\2\110\3\172\2\110\1\172\1\110\1\172\1\110\7\111"+ "\1\112\24\111\6\0\1\175\33\0\1\175\13\0\1\115"+ "\15\0\3\120\1\121\1\122\1\0\1\120\1\122\3\0"+ "\1\124\2\0\5\120\3\0\1\120\11\0\1\122\2\0"+ "\1\122\24\0\3\120\1\121\1\122\1\0\1\123\1\122"+ "\3\0\1\124\2\0\1\120\2\123\2\120\1\125\2\0"+ "\1\120\24\0\1\176\14\0\3\120\3\0\1\120\4\0"+ "\1\124\2\0\5\120\3\0\1\120\4\0\4\177\2\0"+ "\2\177\4\0\1\200\2\0\6\177\1\0\2\177\11\0"+ "\1\130\2\0\1\130\27\0\1\127\1\130\2\0\1\130"+ "\20\0\1\132\1\0\1\132\1\133\2\132\1\134\1\0"+ "\1\135\1\133\1\132\1\135\1\132\2\133\12\132\1\133"+ "\2\132\5\0\1\41\26\0\1\41\1\201\1\41\1\201"+ "\3\41\3\201\1\41\1\201\1\41\2\201\12\41\1\201"+ "\2\41\5\202\1\0\1\202\1\0\1\202\3\0\1\202"+ "\2\0\12\202\1\0\2\202\1\203\3\137\1\204\1\137"+ "\1\204\1\0\2\137\1\204\3\137\1\205\1\137\1\203"+ "\2\137\3\203\2\137\1\203\1\137\1\203\1\137\1\140"+ "\1\0\4\140\1\142\1\0\1\143\2\140\1\143\20\140"+ "\5\0\1\47\26\0\34\112\22\0\1\116\11\0\1\147"+ "\1\0\1\147\1\150\2\147\1\151\1\0\1\152\1\150"+ "\1\147\1\152\1\147\2\150\12\147\1\150\2\147\5\0"+ "\1\55\32\0\3\154\3\0\1\154\4\0\1\156\2\0"+ "\5\154\3\0\1\154\5\0\3\154\3\0\1\155\4\0"+ "\1\156\2\0\1\154\2\155\2\154\1\157\2\0\1\154"+ "\24\0\1\206\13\0\4\207\2\0\2\207\4\0\1\210"+ "\2\0\6\207\1\0\2\207\1\0\1\161\1\0\1\161"+ "\1\162\2\161\1\163\1\0\1\67\1\162\1\161\1\67"+ "\1\161\2\162\12\161\1\162\2\161\5\0\1\67\26\0"+ "\1\164\1\0\4\164\1\166\1\0\1\71\2\164\1\71"+ "\20\164\5\0\1\71\26\0\1\211\3\171\1\212\1\0"+ "\1\142\1\0\1\171\1\0\1\212\1\171\2\0\1\213"+ "\1\171\1\211\2\171\3\211\2\171\1\211\1\0\1\211"+ "\1\171\1\214\1\110\2\214\1\215\1\216\1\173\1\0"+ "\1\217\1\214\1\215\1\217\2\214\1\220\15\214\1\172"+ "\1\110\2\172\1\215\1\172\1\215\1\0\1\110\1\172"+ "\1\215\1\110\2\172\1\221\15\172\1\47\3\0\1\142"+ "\1\0\1\142\3\0\1\142\5\0\1\47\2\0\3\47"+ "\2\0\1\47\1\0\1\47\24\0\1\120\13\0\4\177"+ "\2\0\2\177\1\0\1\222\2\0\1\200\2\0\6\177"+ "\1\0\2\177\24\0\1\223\10\0\1\224\3\202\1\225"+ "\1\0\1\151\1\0\1\202\1\0\1\225\1\202\2\0"+ "\1\226\1\202\1\224\2\202\3\224\2\202\1\224\1\0"+ "\1\224\1\202\1\227\1\137\1\227\1\230\1\231\1\230"+ "\1\204\1\0\1\232\1\230\1\231\1\232\1\227\1\230"+ "\1\233\12\227\1\230\2\227\1\203\1\137\1\203\1\137"+ "\1\231\1\203\1\231\1\0\2\137\1\231\1\137\1\203"+ "\1\137\1\205\12\203\1\137\2\203\1\55\3\0\1\151"+ "\1\0\1\151\3\0\1\151\5\0\1\55\2\0\3\55"+ "\2\0\1\55\1\0\1\55\24\0\1\154\13\0\4\207"+ "\2\0\2\207\1\0\1\167\2\0\1\210\2\0\6\207"+ "\1\0\2\207\24\0\1\234\10\0\1\235\1\171\2\235"+ "\1\236\1\141\1\142\1\0\1\237\1\140\1\236\1\237"+ "\2\140\1\240\12\235\1\140\2\235\1\211\1\171\2\211"+ "\1\236\1\47\1\241\1\0\1\171\1\47\1\236\1\171"+ "\2\47\1\242\12\211\1\47\2\211\1\47\3\0\1\142"+ "\1\0\1\142\3\0\1\142\3\0\1\174\1\0\1\47"+ "\2\0\3\47\2\0\1\47\1\0\1\47\1\0\1\214"+ "\1\110\2\214\1\215\1\214\1\173\1\0\1\217\1\214"+ "\1\215\1\217\2\214\1\220\16\214\1\110\2\214\1\215"+ "\1\214\1\215\1\0\1\217\1\214\1\215\1\217\2\214"+ "\1\220\15\214\1\172\3\110\1\173\1\172\1\173\1\0"+ "\2\110\1\173\3\110\1\174\1\110\1\172\2\110\3\172"+ "\2\110\1\172\1\110\1\172\1\110\1\140\1\0\2\140"+ "\1\241\1\140\1\142\1\0\1\143\1\140\1\241\1\143"+ "\21\140\1\0\2\140\1\241\1\141\1\142\1\0\1\143"+ "\1\140\1\241\1\143\20\140\7\0\1\121\1\122\2\0"+ "\1\122\43\0\1\177\10\0\1\243\1\202\1\243\1\244"+ "\1\245\1\150\1\151\1\0\1\246\1\150\1\245\1\246"+ "\1\147\1\150\1\247\12\243\1\150\2\243\1\224\1\202"+ "\1\224\1\202\1\245\1\55\1\250\1\0\1\202\1\0"+ "\1\245\1\202\1\55\1\0\1\226\12\224\1\0\2\224"+ "\1\55\3\0\1\151\1\0\1\151\3\0\1\151\3\0"+ "\1\205\1\0\1\55\2\0\3\55\2\0\1\55\1\0"+ "\1\55\1\0\1\227\1\137\1\227\1\230\1\231\1\227"+ "\1\204\1\0\1\232\1\230\1\231\1\232\1\227\1\230"+ "\1\233\12\227\1\230\2\227\1\203\3\137\1\204\1\203"+ "\1\204\1\0\2\137\1\204\3\137\1\205\1\137\1\203"+ "\2\137\3\203\2\137\1\203\1\137\1\203\1\137\1\227"+ "\1\137\1\227\1\230\1\231\1\227\1\231\1\0\1\232"+ "\1\230\1\231\1\232\1\227\1\230\1\233\12\227\1\230"+ "\2\227\1\55\3\0\1\151\1\55\1\151\3\0\1\151"+ "\5\0\1\55\2\0\3\55\2\0\1\55\1\0\1\55"+ "\24\0\1\207\10\0\1\235\1\171\2\235\1\236\1\140"+ "\1\142\1\0\1\237\1\140\1\236\1\237\2\140\1\240"+ "\12\235\1\140\3\235\1\171\2\235\1\236\1\140\1\241"+ "\1\0\1\237\1\140\1\236\1\237\2\140\1\240\12\235"+ "\1\140\2\235\1\140\1\0\2\140\1\241\1\140\1\142"+ "\1\0\1\143\1\140\1\241\1\143\2\140\1\220\16\140"+ "\1\0\4\140\1\241\1\0\1\143\2\140\1\143\21\140"+ "\1\0\2\140\1\241\1\141\1\142\1\0\1\143\1\140"+ "\1\241\1\143\2\140\1\220\15\140\1\243\1\202\1\243"+ "\1\244\1\245\1\147\1\151\1\0\1\246\1\150\1\245"+ "\1\246\1\147\1\150\1\247\12\243\1\150\2\243\1\224"+ "\3\202\1\225\1\55\1\151\1\0\1\202\1\0\1\225"+ "\1\202\2\0\1\226\1\202\1\224\2\202\3\224\2\202"+ "\1\224\1\0\1\224\1\202\1\243\1\202\1\243\1\244"+ "\1\245\1\147\1\250\1\0\1\246\1\150\1\245\1\246"+ "\1\147\1\150\1\247\12\243\1\150\2\243\1\55\3\0"+ "\1\151\1\55\1\151\3\0\1\151\3\0\1\205\1\0"+ "\1\55\2\0\3\55\2\0\1\55\1\0\1\55\1\0"+ "\1\147\1\0\1\147\1\150\2\147\1\250\1\0\1\152"+ "\1\150\1\147\1\152\1\147\2\150\12\147\1\150\2\147"; private static int [] zzUnpackTrans() { int [] result = new int[3668]; 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 = "\15\0\1\1\2\11\3\1\1\11\1\1\1\11\3\1"+ "\1\11\4\1\1\11\22\1\1\11\2\1\1\11\1\1"+ "\4\0\2\1\1\0\1\1\1\0\1\11\1\1\1\11"+ "\1\1\1\11\1\1\6\0\1\1\2\0\1\1\1\0"+ "\1\11\1\1\4\0\1\11\1\1\1\0\1\1\1\0"+ "\1\1\3\0\1\1\4\0\1\11\2\1\3\0\1\11"+ "\2\1\5\0\1\1\2\0\1\1\2\11\1\0\1\1"+ "\2\0\1\11\3\0\1\11\1\0\1\1\5\0\1\1"+ "\2\0\2\1\2\0\2\1\2\0\1\1\2\0\1\1"+ "\1\0\1\1\3\0\2\1\1\0\4\1\1\0\1\1"+ "\2\0\1\1"; private static int [] zzUnpackAttribute() { int [] result = new int[168]; 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; /** For the backwards DFA of general lookahead statements */ private boolean [] zzFin = new boolean [ZZ_BUFFERSIZE+1]; /* user code: */ private int currentLineIndent = 0; private int valueIndent = -1; private int braceCount = 0; private IElementType valueTokenType = null; private int previousState = YYINITIAL; public boolean isCleanState() { return yystate() == YYINITIAL && currentLineIndent == 0 && braceCount == 0; } public void cleanMyState() { currentLineIndent = 0; braceCount = 0; } private char previousChar() { return getChar(-1); } private char getChar(final int offset) { final int loc = getTokenStart() + offset; return 0 <= loc && loc < zzBuffer.length() ? zzBuffer.charAt(loc) : (char) -1; } private char getCharAfter(final int offset) { final int loc = getTokenEnd() + offset; return 0 <= loc && loc < zzBuffer.length() ? zzBuffer.charAt(loc) : (char) -1; } private IElementType getWhitespaceTypeAndUpdateIndent() { if (isAfterEol()) { currentLineIndent = yylength(); return INDENT; } else { return WHITESPACE; } } private boolean isAfterEol() { final char prev = previousChar(); return prev == (char)-1 || prev == '\n'; } private boolean isAfterSpace() { final char prev = previousChar(); return prev == (char)-1 || prev == '\t' || prev == ' '; } private void yyBegin(int newState) { //System.out.println("yybegin(): " + newState); yybegin(newState); } private boolean startsWith(CharSequence haystack, CharSequence needle) { for (int i = Math.min(haystack.length(), needle.length()) - 1; i >= 0; i--) { if (haystack.charAt(i) != needle.charAt(i)) { return false; } } return true; } private IElementType tokenOrForbidden(IElementType tokenType) { if (!isAfterEol() || yylength() < 3) { return tokenType; } if (startsWith(yytext(), "---")) { braceCount = 0; yyBegin(YYINITIAL); yypushback(yylength() - 3); return DOCUMENT_MARKER; } if (startsWith(yytext(), "...")) { braceCount = 0; yyBegin(YYINITIAL); yypushback(yylength() - 3); return DOCUMENT_END; } return tokenType; } /** * Creates a new scanner * * @param in the java.io.Reader to read input from. */ public _YAMLLexer(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: { return tokenOrForbidden(TEXT); } case 27: break; case 2: { return TEXT; } case 28: break; case 3: { if (braceCount > 0) { yyBegin(BRACES); return COMMA; } yyBegin(VALUE); return TEXT; } case 29: break; case 4: { return QUESTION; } case 30: break; case 5: { // YAML spec: when a comment follows another syntax element, // it must be separated from it by space characters. return (isAfterEol() || isAfterSpace()) ? COMMENT : TEXT; } case 31: break; case 6: { if (braceCount == 0) { yyBegin(YYINITIAL); } currentLineIndent = 0; return EOL; } case 32: break; case 7: { return getWhitespaceTypeAndUpdateIndent(); } case 33: break; case 8: { if (braceCount == 0) { yyBegin(VALUE); return TEXT; } braceCount--; if (yystate() == BRACES && braceCount == 0){ yyBegin(previousState); } return RBRACKET; } case 34: break; case 9: { braceCount++; if (braceCount != 0 && yystate() != BRACES) { previousState = yystate(); } yyBegin(braceCount == 0 ? previousState: BRACES); return LBRACE; } case 35: break; case 10: { if (braceCount == 0) { yyBegin(VALUE); return TEXT; } braceCount--; if (yystate() == BRACES && braceCount == 0){ yyBegin(previousState); } return RBRACE; } case 36: break; case 11: { braceCount++; if (braceCount != 0 && yystate() != BRACES) { previousState = yystate(); } yyBegin(braceCount == 0 ? previousState: BRACES); return LBRACKET; } case 37: break; case 12: { if (currentLineIndent <= valueIndent) { yypushback(yylength()); yyBegin(YYINITIAL); break; } else { return valueTokenType; } } case 38: break; case 13: { currentLineIndent = 0; return EOL; } case 39: break; case 14: { IElementType type = getWhitespaceTypeAndUpdateIndent(); if (currentLineIndent <= valueIndent) { yyBegin(YYINITIAL); } return type; } case 40: break; case 15: { if (zzMarkedPos == zzEndRead){ return SCALAR_KEY; } yyBegin(VALUE); return tokenOrForbidden(TEXT); } case 41: break; case 16: // lookahead expression with fixed base length zzMarkedPos = Character.offsetByCodePoints (zzBufferL/*, zzStartRead, zzEndRead - zzStartRead*/, zzStartRead, 1); { return COLON; } case 42: break; case 17: // lookahead expression with fixed base length zzMarkedPos = Character.offsetByCodePoints (zzBufferL/*, zzStartRead, zzEndRead - zzStartRead*/, zzStartRead, 1); { yyBegin(VALUE_OR_KEY); return SEQUENCE_MARKER; } case 43: break; case 18: // general lookahead, find correct zzMarkedPos { int zzFState = 11; int zzFPos = zzStartRead; if (zzFin.length <= zzBufferL.length()) { zzFin = new boolean[zzBufferL.length()+1]; } boolean zzFinL[] = zzFin; while (zzFState != -1 && zzFPos < zzMarkedPos) { zzFinL[zzFPos] = ((zzAttrL[zzFState] & 1) == 1); zzInput = Character.codePointAt(zzBufferL, zzFPos/*, zzMarkedPos*/); zzFPos += Character.charCount(zzInput); zzFState = zzTransL[ zzRowMapL[zzFState] + ZZ_CMAP(zzInput) ]; } if (zzFState != -1) { zzFinL[zzFPos++] = ((zzAttrL[zzFState] & 1) == 1); } while (zzFPos <= zzMarkedPos) { zzFinL[zzFPos++] = false; } zzFState = 6; zzFPos = zzMarkedPos; while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) { zzInput = Character.codePointBefore(zzBufferL, zzFPos/*, zzStartRead*/); zzFPos -= Character.charCount(zzInput); zzFState = zzTransL[ zzRowMapL[zzFState] + ZZ_CMAP(zzInput) ]; }; zzMarkedPos = zzFPos; } { yyBegin(INDENT_VALUE); valueIndent = currentLineIndent; valueTokenType = SCALAR_TEXT; return valueTokenType; } case 44: break; case 19: { return SCALAR_DSTRING; } case 45: break; case 20: { return SCALAR_STRING; } case 46: break; case 21: // general lookahead, find correct zzMarkedPos { int zzFState = 5; int zzFPos = zzStartRead; if (zzFin.length <= zzBufferL.length()) { zzFin = new boolean[zzBufferL.length()+1]; } boolean zzFinL[] = zzFin; while (zzFState != -1 && zzFPos < zzMarkedPos) { zzFinL[zzFPos] = ((zzAttrL[zzFState] & 1) == 1); zzInput = Character.codePointAt(zzBufferL, zzFPos/*, zzMarkedPos*/); zzFPos += Character.charCount(zzInput); zzFState = zzTransL[ zzRowMapL[zzFState] + ZZ_CMAP(zzInput) ]; } if (zzFState != -1) { zzFinL[zzFPos++] = ((zzAttrL[zzFState] & 1) == 1); } while (zzFPos <= zzMarkedPos) { zzFinL[zzFPos++] = false; } zzFState = 6; zzFPos = zzMarkedPos; while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) { zzInput = Character.codePointBefore(zzBufferL, zzFPos/*, zzStartRead*/); zzFPos -= Character.charCount(zzInput); zzFState = zzTransL[ zzRowMapL[zzFState] + ZZ_CMAP(zzInput) ]; }; zzMarkedPos = zzFPos; } { return TAG; } case 47: break; case 22: // general lookahead, find correct zzMarkedPos { int zzFState = 12; int zzFPos = zzStartRead; if (zzFin.length <= zzBufferL.length()) { zzFin = new boolean[zzBufferL.length()+1]; } boolean zzFinL[] = zzFin; while (zzFState != -1 && zzFPos < zzMarkedPos) { zzFinL[zzFPos] = ((zzAttrL[zzFState] & 1) == 1); zzInput = Character.codePointAt(zzBufferL, zzFPos/*, zzMarkedPos*/); zzFPos += Character.charCount(zzInput); zzFState = zzTransL[ zzRowMapL[zzFState] + ZZ_CMAP(zzInput) ]; } if (zzFState != -1) { zzFinL[zzFPos++] = ((zzAttrL[zzFState] & 1) == 1); } while (zzFPos <= zzMarkedPos) { zzFinL[zzFPos++] = false; } zzFState = 6; zzFPos = zzMarkedPos; while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) { zzInput = Character.codePointBefore(zzBufferL, zzFPos/*, zzStartRead*/); zzFPos -= Character.charCount(zzInput); zzFState = zzTransL[ zzRowMapL[zzFState] + ZZ_CMAP(zzInput) ]; }; zzMarkedPos = zzFPos; } { yyBegin(INDENT_VALUE); valueIndent = currentLineIndent; valueTokenType = SCALAR_LIST; return valueTokenType; } case 48: break; case 23: // lookahead expression with fixed lookahead length zzMarkedPos = Character.offsetByCodePoints (zzBufferL/*, zzStartRead, zzEndRead - zzStartRead*/, zzMarkedPos, -1); { return getWhitespaceTypeAndUpdateIndent(); } case 49: break; case 24: // general lookahead, find correct zzMarkedPos { int zzFState = 9; int zzFPos = zzStartRead; if (zzFin.length <= zzBufferL.length()) { zzFin = new boolean[zzBufferL.length()+1]; } boolean zzFinL[] = zzFin; while (zzFState != -1 && zzFPos < zzMarkedPos) { zzFinL[zzFPos] = ((zzAttrL[zzFState] & 1) == 1); zzInput = Character.codePointAt(zzBufferL, zzFPos/*, zzMarkedPos*/); zzFPos += Character.charCount(zzInput); zzFState = zzTransL[ zzRowMapL[zzFState] + ZZ_CMAP(zzInput) ]; } if (zzFState != -1) { zzFinL[zzFPos++] = ((zzAttrL[zzFState] & 1) == 1); } while (zzFPos <= zzMarkedPos) { zzFinL[zzFPos++] = false; } zzFState = 10; zzFPos = zzMarkedPos; while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) { zzInput = Character.codePointBefore(zzBufferL, zzFPos/*, zzStartRead*/); zzFPos -= Character.charCount(zzInput); zzFState = zzTransL[ zzRowMapL[zzFState] + ZZ_CMAP(zzInput) ]; }; zzMarkedPos = zzFPos; } { yyBegin(VALUE); return SCALAR_KEY; } case 50: break; case 25: { return SCALAR_KEY; } case 51: break; case 26: // general lookahead, find correct zzMarkedPos { int zzFState = 7; int zzFPos = zzStartRead; if (zzFin.length <= zzBufferL.length()) { zzFin = new boolean[zzBufferL.length()+1]; } boolean zzFinL[] = zzFin; while (zzFState != -1 && zzFPos < zzMarkedPos) { zzFinL[zzFPos] = ((zzAttrL[zzFState] & 1) == 1); zzInput = Character.codePointAt(zzBufferL, zzFPos/*, zzMarkedPos*/); zzFPos += Character.charCount(zzInput); zzFState = zzTransL[ zzRowMapL[zzFState] + ZZ_CMAP(zzInput) ]; } if (zzFState != -1) { zzFinL[zzFPos++] = ((zzAttrL[zzFState] & 1) == 1); } while (zzFPos <= zzMarkedPos) { zzFinL[zzFPos++] = false; } zzFState = 8; zzFPos = zzMarkedPos; while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) { zzInput = Character.codePointBefore(zzBufferL, zzFPos/*, zzStartRead*/); zzFPos -= Character.charCount(zzInput); zzFState = zzTransL[ zzRowMapL[zzFState] + ZZ_CMAP(zzInput) ]; }; zzMarkedPos = zzFPos; } { yyBegin(VALUE_BRACE); return SCALAR_KEY; } case 52: break; default: zzScanError(ZZ_NO_MATCH); } } } } }