From 0d8d0cd1c82517bee9505b81553308d9e9fe681a Mon Sep 17 00:00:00 2001 From: JaDogg Date: Mon, 27 May 2024 23:33:36 +0100 Subject: [PATCH] feat(yakshaintellij): add enum syntax highlight support \ --- .../intellij/sdk/language/YakshaLexer.java | 1141 +++++++++-------- .../sdk/language/parser/YakshaParser.java | 124 +- .../sdk/language/psi/YakshaEnumBits.java | 16 + .../sdk/language/psi/YakshaEnumBlock.java | 16 + .../sdk/language/psi/YakshaEnumField.java | 25 + .../language/psi/YakshaEnumFieldWoIndent.java | 22 + .../sdk/language/psi/YakshaEnumStatement.java | 29 + .../language/psi/YakshaOuterStatement.java | 3 + .../sdk/language/psi/YakshaTypes.java | 21 + .../sdk/language/psi/YakshaVisitor.java | 20 + .../language/psi/impl/YakshaEnumBitsImpl.java | 42 + .../psi/impl/YakshaEnumBlockImpl.java | 42 + .../psi/impl/YakshaEnumFieldImpl.java | 36 + .../psi/impl/YakshaEnumFieldWoIndentImpl.java | 30 + .../psi/impl/YakshaEnumStatementImpl.java | 42 + .../psi/impl/YakshaOuterStatementImpl.java | 6 + .../java/org/intellij/sdk/language/Yaksha.bnf | 19 +- .../org/intellij/sdk/language/Yaksha.flex | 5 +- .../sdk/language/YakshaSyntaxHighlighter.java | 1 + 19 files changed, 1086 insertions(+), 554 deletions(-) create mode 100644 editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaEnumBits.java create mode 100644 editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaEnumBlock.java create mode 100644 editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaEnumField.java create mode 100644 editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaEnumFieldWoIndent.java create mode 100644 editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaEnumStatement.java create mode 100644 editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaEnumBitsImpl.java create mode 100644 editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaEnumBlockImpl.java create mode 100644 editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaEnumFieldImpl.java create mode 100644 editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaEnumFieldWoIndentImpl.java create mode 100644 editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaEnumStatementImpl.java diff --git a/editor/intellij/src/main/gen/org/intellij/sdk/language/YakshaLexer.java b/editor/intellij/src/main/gen/org/intellij/sdk/language/YakshaLexer.java index 3ca758e4..accbb67c 100644 --- a/editor/intellij/src/main/gen/org/intellij/sdk/language/YakshaLexer.java +++ b/editor/intellij/src/main/gen/org/intellij/sdk/language/YakshaLexer.java @@ -1,19 +1,14 @@ -/* The following code was generated by JFlex 1.7.0 tweaked for IntelliJ platform */ +// Generated by JFlex 1.9.1 http://jflex.de/ (tweaked for IntelliJ platform) +// source: Yaksha.flex package org.intellij.sdk.language; import com.intellij.lexer.FlexLexer; +import com.intellij.psi.TokenType; import com.intellij.psi.tree.IElementType; -import org.intellij.sdk.language.psi.YakshaTokenType; import org.intellij.sdk.language.psi.YakshaTypes; -import com.intellij.psi.TokenType; -/** - * This class is a scanner generated by - * JFlex 1.7.0 - * from the specification file Yaksha.flex - */ class YakshaLexer implements FlexLexer { /** This character denotes the end of file */ @@ -31,59 +26,99 @@ class YakshaLexer implements FlexLexer { * 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[] = { + private static final int ZZ_LEXSTATE[] = { 0, 0 }; - /** - * Translates characters to character classes - * Chosen bits are [8, 6, 7] - * Total runtime size is 1040 bytes + /** + * Top-level table for translating characters to character classes */ - public static int ZZ_CMAP(int ch) { - return ZZ_CMAP_A[ZZ_CMAP_Y[ZZ_CMAP_Z[ch>>13]|((ch>>7)&0x3f)]|(ch&0x7f)]; + private static final int [] ZZ_CMAP_TOP = zzUnpackcmap_top(); + + private static final String ZZ_CMAP_TOP_PACKED_0 = + "\1\0\u10ff\u0100"; + + private static int [] zzUnpackcmap_top() { + int [] result = new int[4352]; + int offset = 0; + offset = zzUnpackcmap_top(ZZ_CMAP_TOP_PACKED_0, offset, result); + return result; } - /* The ZZ_CMAP_Z table has 136 entries */ - static final char ZZ_CMAP_Z[] = zzUnpackCMap( - "\1\0\207\100"); + private static int zzUnpackcmap_top(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 ZZ_CMAP_Y table has 128 entries */ - static final char ZZ_CMAP_Y[] = zzUnpackCMap( - "\1\0\177\200"); - /* The ZZ_CMAP_A table has 256 entries */ - static final char ZZ_CMAP_A[] = zzUnpackCMap( - "\11\0\1\3\1\2\2\0\1\1\22\0\1\4\1\101\1\35\1\5\1\0\1\73\1\75\1\33\1\61\1\62"+ - "\1\71\1\32\1\104\1\67\1\30\1\72\1\10\1\14\1\17\1\16\1\20\1\24\1\15\1\24\1"+ - "\13\1\11\1\103\1\105\1\74\1\100\1\70\1\0\1\102\4\22\1\31\1\27\7\6\1\57\1\23"+ - "\4\6\1\56\3\6\1\21\2\6\1\63\1\34\1\64\1\77\1\7\1\0\1\36\1\25\1\43\1\47\1\41"+ - "\1\51\1\6\1\55\1\12\1\6\1\42\1\44\1\52\1\50\1\26\1\53\1\6\1\40\1\37\1\45\1"+ - "\46\1\60\1\54\1\21\2\6\1\65\1\76\1\66\1\106\201\0"); + /** + * Second-level tables for translating characters to character classes + */ + private static final int [] ZZ_CMAP_BLOCKS = zzUnpackcmap_blocks(); + + private static final String ZZ_CMAP_BLOCKS_PACKED_0 = + "\11\0\1\1\1\2\2\0\1\3\22\0\1\4\1\5"+ + "\1\6\1\7\1\0\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\24"+ + "\1\25\1\26\1\27\1\30\1\31\1\30\1\32\1\33"+ + "\1\34\1\35\1\36\1\37\1\40\1\0\1\41\1\42"+ + "\1\43\2\42\1\44\1\45\7\46\1\47\1\50\4\46"+ + "\1\51\3\46\1\52\2\46\1\53\1\54\1\55\1\56"+ + "\1\57\1\0\1\60\1\61\1\62\1\63\1\64\1\65"+ + "\1\46\1\66\1\67\1\46\1\70\1\71\1\72\1\73"+ + "\1\74\1\75\1\46\1\76\1\77\1\100\1\101\1\102"+ + "\1\103\1\52\2\46\1\104\1\105\1\106\1\107\u0181\0"; + + private static int [] zzUnpackcmap_blocks() { + int [] result = new int[512]; + int offset = 0; + offset = zzUnpackcmap_blocks(ZZ_CMAP_BLOCKS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackcmap_blocks(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 DFA states to action switch labels. */ private static final int [] ZZ_ACTION = zzUnpackAction(); private static final String ZZ_ACTION_PACKED_0 = - "\1\0\1\1\2\2\2\3\1\4\1\5\2\6\4\5"+ - "\1\7\1\10\2\11\16\5\1\12\1\13\1\14\1\15"+ - "\1\16\1\17\1\20\1\21\1\22\1\23\1\24\1\21"+ - "\1\25\1\26\1\27\1\30\1\31\1\32\1\33\1\34"+ - "\1\35\1\36\1\3\2\4\1\6\4\0\2\6\1\0"+ - "\1\37\3\5\1\40\1\41\3\5\1\42\1\5\1\43"+ - "\6\11\1\44\22\5\1\45\1\46\1\47\1\21\1\50"+ - "\1\51\1\52\1\53\1\54\1\55\1\56\1\3\3\0"+ - "\4\6\1\0\4\5\3\11\1\57\1\37\10\5\1\60"+ - "\1\61\1\62\1\63\6\5\1\64\1\65\1\66\3\5"+ - "\4\0\3\5\1\67\1\70\7\5\1\71\1\5\1\72"+ - "\1\73\1\5\1\74\1\75\2\0\4\5\1\76\1\77"+ - "\1\5\1\100\1\5\1\101\1\102\1\103\1\104\3\5"+ - "\1\105\4\5\1\106\2\5\1\107\4\5\1\110"; + "\1\0\1\1\1\2\2\3\1\2\1\4\1\5\1\6"+ + "\1\7\1\10\1\5\1\11\1\12\1\13\1\14\1\15"+ + "\1\16\1\17\1\20\2\21\1\22\1\23\1\24\1\25"+ + "\1\24\1\26\4\27\1\30\1\31\1\32\17\27\1\33"+ + "\1\34\1\35\1\36\1\2\1\24\3\5\2\6\1\37"+ + "\1\40\3\5\1\41\1\42\1\43\1\44\1\21\1\45"+ + "\1\21\2\0\1\21\3\0\1\46\1\47\3\27\1\50"+ + "\1\27\1\51\16\27\1\52\1\53\1\27\1\54\2\27"+ + "\1\55\5\27\1\56\1\2\3\5\1\21\1\0\3\21"+ + "\3\0\1\57\1\60\3\27\1\61\5\27\1\62\1\63"+ + "\5\27\1\64\2\27\1\65\3\27\1\52\1\27\1\66"+ + "\4\0\1\27\1\67\1\70\6\27\1\71\1\72\1\73"+ + "\3\27\1\74\4\27\2\0\1\75\1\76\1\77\1\100"+ + "\1\27\1\101\6\27\1\102\2\27\1\103\1\104\1\105"+ + "\1\27\1\106\3\27\1\107\2\27\1\110\5\27\1\111"; private static int [] zzUnpackAction() { - int [] result = new int[210]; + int [] result = new int[213]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; @@ -102,42 +137,42 @@ private static int zzUnpackAction(String packed, int offset, int [] result) { } - /** + /** * 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\107\0\216\0\107\0\325\0\u011c\0\u0163\0\u01aa"+ - "\0\u01f1\0\u0238\0\u027f\0\u02c6\0\u030d\0\u0354\0\u039b\0\u03e2"+ - "\0\u0429\0\u0470\0\u04b7\0\u04fe\0\u0545\0\u058c\0\u05d3\0\u061a"+ - "\0\u0661\0\u06a8\0\u06ef\0\u0736\0\u077d\0\u07c4\0\u080b\0\u0852"+ - "\0\107\0\107\0\107\0\107\0\107\0\107\0\u0899\0\u08e0"+ - "\0\u0927\0\u096e\0\u09b5\0\u09fc\0\u0a43\0\u0a8a\0\u0ad1\0\u0b18"+ - "\0\u0b18\0\107\0\107\0\107\0\107\0\107\0\u0b5f\0\u0ba6"+ - "\0\107\0\u0bed\0\u0c34\0\u0c7b\0\u0cc2\0\u0d09\0\107\0\u0d50"+ - "\0\u0d97\0\u01aa\0\u0dde\0\u0e25\0\u0e6c\0\u0eb3\0\u01aa\0\u0efa"+ - "\0\u0f41\0\u0f88\0\u01aa\0\u0fcf\0\107\0\u1016\0\u105d\0\u10a4"+ - "\0\u10eb\0\u1132\0\u1179\0\u01aa\0\u11c0\0\u1207\0\u124e\0\u1295"+ - "\0\u12dc\0\u1323\0\u136a\0\u13b1\0\u13f8\0\u143f\0\u1486\0\u14cd"+ - "\0\u1514\0\u155b\0\u15a2\0\u15e9\0\u1630\0\u1677\0\107\0\107"+ - "\0\u16be\0\107\0\107\0\107\0\107\0\u1705\0\107\0\107"+ - "\0\107\0\u174c\0\u1793\0\u17da\0\u1821\0\u1868\0\u18af\0\u18f6"+ - "\0\u193d\0\u1984\0\u19cb\0\u1a12\0\u1a59\0\u1aa0\0\107\0\u1ae7"+ - "\0\u1b2e\0\u01aa\0\u1b75\0\u1bbc\0\u1c03\0\u1c4a\0\u1c91\0\u1cd8"+ - "\0\u1d1f\0\u1d66\0\u1dad\0\u01aa\0\u1df4\0\u01aa\0\u01aa\0\u1e3b"+ - "\0\u1e82\0\u1ec9\0\u1f10\0\u1f57\0\u1f9e\0\107\0\107\0\u1fe5"+ - "\0\u202c\0\u2073\0\u20ba\0\u2101\0\u2148\0\u218f\0\u21d6\0\u221d"+ - "\0\u2264\0\u22ab\0\u01aa\0\u01aa\0\u22f2\0\u2339\0\u2380\0\u23c7"+ - "\0\u240e\0\u0eb3\0\u2455\0\u01aa\0\u249c\0\u01aa\0\u01aa\0\u24e3"+ - "\0\u01aa\0\u01aa\0\u252a\0\u2571\0\u25b8\0\u25ff\0\u2646\0\u268d"+ - "\0\u01aa\0\u01aa\0\u26d4\0\u01aa\0\u271b\0\u01aa\0\u01aa\0\u01aa"+ - "\0\u01aa\0\u2762\0\u27a9\0\u27f0\0\u01aa\0\u2837\0\u287e\0\u28c5"+ - "\0\u290c\0\u01aa\0\u2953\0\u299a\0\u01aa\0\u29e1\0\u2a28\0\u2a6f"+ - "\0\u2ab6\0\u01aa"; + "\0\0\0\110\0\220\0\110\0\330\0\u0120\0\u0168\0\u01b0"+ + "\0\u01f8\0\u0240\0\u0288\0\u02d0\0\110\0\110\0\u0318\0\u0360"+ + "\0\110\0\u03a8\0\u03f0\0\u0438\0\u0480\0\u04c8\0\110\0\110"+ + "\0\u0510\0\u0168\0\u0558\0\110\0\u05a0\0\u05e8\0\u0630\0\u0678"+ + "\0\110\0\110\0\u06c0\0\u0708\0\u0750\0\u0798\0\u07e0\0\u0828"+ + "\0\u0870\0\u08b8\0\u0900\0\u0948\0\u0990\0\u09d8\0\u0a20\0\u0a68"+ + "\0\u0ab0\0\u0af8\0\110\0\u0b40\0\110\0\110\0\u0b88\0\110"+ + "\0\u0bd0\0\u0c18\0\u0c60\0\110\0\u0ca8\0\110\0\110\0\u0cf0"+ + "\0\u0d38\0\u0d80\0\110\0\110\0\110\0\110\0\u0dc8\0\110"+ + "\0\u0e10\0\u0e58\0\u0ea0\0\110\0\u0ee8\0\u0f30\0\u0f78\0\u0fc0"+ + "\0\u1008\0\u1050\0\u1098\0\u10e0\0\110\0\u1128\0\u05a0\0\u1170"+ + "\0\u11b8\0\u1200\0\u1248\0\u1290\0\u12d8\0\u1320\0\u1368\0\u13b0"+ + "\0\u13f8\0\u1440\0\u1488\0\u14d0\0\u1518\0\u05a0\0\u05a0\0\u1560"+ + "\0\u15a8\0\u15f0\0\u1638\0\u05a0\0\u1680\0\u16c8\0\u1710\0\u1758"+ + "\0\u17a0\0\110\0\u17e8\0\110\0\u1830\0\u1878\0\u18c0\0\u1908"+ + "\0\u1950\0\u1998\0\u19e0\0\u1a28\0\u1a70\0\u1ab8\0\110\0\110"+ + "\0\u1b00\0\u1b48\0\u1b90\0\u05a0\0\u1bd8\0\u1c20\0\u1c68\0\u1cb0"+ + "\0\u1cf8\0\u1d40\0\u05a0\0\u1d88\0\u1dd0\0\u1e18\0\u1e60\0\u1ea8"+ + "\0\u05a0\0\u1ef0\0\u1f38\0\u05a0\0\u1f80\0\u1fc8\0\u2010\0\u2058"+ + "\0\u20a0\0\u20e8\0\u2130\0\u2178\0\u21c0\0\u2208\0\u2250\0\u05a0"+ + "\0\u05a0\0\u2298\0\u22e0\0\u2328\0\u2370\0\u23b8\0\u2400\0\u05a0"+ + "\0\u05a0\0\u05a0\0\u15a8\0\u2448\0\u2490\0\u05a0\0\u24d8\0\u2520"+ + "\0\u2568\0\u25b0\0\u25f8\0\u2640\0\u05a0\0\u05a0\0\u05a0\0\u05a0"+ + "\0\u2688\0\u05a0\0\u26d0\0\u2718\0\u2760\0\u27a8\0\u27f0\0\u2838"+ + "\0\u05a0\0\u2880\0\u28c8\0\u05a0\0\u05a0\0\u05a0\0\u2910\0\u05a0"+ + "\0\u2958\0\u29a0\0\u29e8\0\u05a0\0\u2a30\0\u2a78\0\u05a0\0\u2ac0"+ + "\0\u2b08\0\u2b50\0\u2b98\0\u2be0\0\u05a0"; private static int [] zzUnpackRowMap() { - int [] result = new int[210]; + int [] result = new int[213]; int offset = 0; offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); return result; @@ -146,7 +181,7 @@ private static int zzUnpackAction(String packed, int offset, int [] 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(); + int l = packed.length() - 1; while (i < l) { int high = packed.charAt(i++) << 16; result[j++] = high | packed.charAt(i++); @@ -154,167 +189,166 @@ private static int zzUnpackRowMap(String packed, int offset, int [] result) { return j; } - /** + /** * The transition table of the DFA */ - private static final int [] ZZ_TRANS = zzUnpackTrans(); + private static final int [] ZZ_TRANS = zzUnpacktrans(); private static final String ZZ_TRANS_PACKED_0 = - "\1\2\1\3\1\4\1\5\1\6\1\7\1\10\1\2"+ - "\1\11\1\12\1\13\6\12\3\10\1\12\1\14\1\15"+ - "\1\16\1\17\1\10\1\20\1\21\1\2\1\22\1\23"+ - "\1\24\1\25\1\26\1\10\1\27\2\10\1\30\1\31"+ - "\1\32\1\33\1\34\1\35\1\36\1\10\1\37\1\40"+ - "\1\10\1\41\1\42\1\43\1\44\1\45\1\46\1\47"+ - "\1\50\1\51\1\52\1\53\1\54\1\55\1\56\1\57"+ - "\1\60\1\61\1\62\1\63\1\64\1\65\1\66\111\0"+ - "\1\4\107\0\2\5\1\7\104\0\1\5\1\67\1\7"+ - "\101\0\1\7\1\70\1\71\104\7\6\0\22\10\1\0"+ - "\1\10\4\0\23\10\36\0\2\72\1\73\6\72\1\74"+ - "\1\0\1\75\1\72\1\76\1\75\1\77\1\100\1\101"+ - "\7\0\1\101\4\0\1\73\2\0\1\77\45\0\2\12"+ - "\1\73\6\12\3\0\1\12\2\0\1\77\1\100\1\101"+ - "\7\0\1\101\4\0\1\73\2\0\1\77\43\0\5\10"+ - "\1\102\1\103\1\104\1\105\11\10\1\0\1\10\4\0"+ - "\12\10\1\106\1\107\1\110\6\10\34\0\20\10\1\111"+ - "\1\10\1\0\1\10\4\0\2\10\1\112\20\10\34\0"+ - "\22\10\1\0\1\10\4\0\2\10\1\113\20\10\34\0"+ - "\22\10\1\0\1\10\4\0\1\114\22\10\36\0\2\100"+ - "\1\0\6\100\3\0\1\100\162\0\1\115\6\0\1\116"+ - "\2\0\30\116\1\117\1\120\52\116\1\121\2\0\31\121"+ - "\1\122\1\123\51\121\6\0\22\10\1\0\1\10\4\0"+ - "\1\10\1\124\10\10\1\125\10\10\34\0\22\10\1\0"+ - "\1\10\4\0\2\10\1\102\4\10\1\126\13\10\34\0"+ - "\22\10\1\0\1\10\4\0\3\10\1\127\4\10\1\130"+ - "\12\10\34\0\22\10\1\0\1\10\4\0\6\10\1\131"+ - "\14\10\34\0\20\10\1\132\1\10\1\0\1\10\4\0"+ - "\5\10\1\133\1\134\14\10\34\0\5\10\1\102\1\103"+ - "\1\104\1\105\11\10\1\0\1\10\4\0\23\10\34\0"+ - "\4\10\1\135\15\10\1\0\1\10\4\0\3\10\1\136"+ - "\17\10\34\0\20\10\1\137\1\10\1\0\1\10\4\0"+ - "\23\10\34\0\7\10\1\104\1\105\7\10\1\140\1\10"+ - "\1\0\1\10\4\0\6\10\1\141\14\10\34\0\22\10"+ - "\1\0\1\10\4\0\1\142\22\10\34\0\22\10\1\0"+ - "\1\10\4\0\1\143\22\10\34\0\22\10\1\0\1\10"+ - "\4\0\17\10\1\144\3\10\34\0\22\10\1\0\1\10"+ - "\4\0\2\10\1\145\20\10\34\0\20\10\1\146\1\10"+ - "\1\0\1\10\4\0\23\10\116\0\1\147\7\0\1\150"+ - "\76\0\1\151\7\0\1\152\106\0\1\153\106\0\1\154"+ - "\106\0\1\155\102\0\1\156\3\0\1\152\106\0\1\157"+ - "\106\0\1\160\106\0\1\161\106\0\1\152\11\0\1\5"+ - "\1\162\1\7\103\0\1\71\114\0\2\72\1\0\6\72"+ - "\3\0\1\72\2\0\1\77\1\100\1\101\7\0\1\101"+ - "\7\0\1\77\50\0\1\77\1\163\1\164\1\165\100\0"+ - "\2\166\1\0\6\166\1\0\1\166\1\0\2\166\1\0"+ - "\1\166\1\0\1\166\4\0\1\166\2\0\1\166\1\0"+ - "\1\166\3\0\1\166\1\0\1\166\45\0\1\167\3\0"+ - "\5\167\3\0\1\167\72\0\1\170\3\0\1\170\102\0"+ - "\2\100\1\0\6\100\3\0\1\100\2\0\1\77\1\0"+ - "\1\101\7\0\1\101\7\0\1\77\45\0\2\171\1\0"+ - "\6\171\3\0\1\171\5\0\1\172\34\0\1\172\25\0"+ - "\7\10\1\102\12\10\1\0\1\10\4\0\23\10\34\0"+ - "\12\10\1\102\7\10\1\0\1\10\4\0\23\10\34\0"+ - "\11\10\1\102\10\10\1\0\1\10\4\0\23\10\34\0"+ - "\22\10\1\0\1\10\4\0\7\10\1\102\13\10\34\0"+ - "\22\10\1\0\1\10\4\0\15\10\1\173\5\10\34\0"+ - "\20\10\1\174\1\10\1\0\1\10\4\0\23\10\34\0"+ - "\22\10\1\0\1\10\4\0\3\10\1\175\17\10\34\0"+ - "\22\10\1\0\1\10\4\0\6\10\1\176\14\10\26\0"+ - "\1\116\2\0\30\116\1\177\1\120\52\116\33\0\1\200"+ - "\53\0\107\116\1\121\2\0\31\121\1\122\1\177\160\121"+ - "\35\0\1\201\57\0\22\10\1\0\1\10\4\0\11\10"+ - "\1\202\11\10\34\0\22\10\1\0\1\10\4\0\2\10"+ - "\1\203\20\10\34\0\22\10\1\0\1\10\4\0\7\10"+ - "\1\204\13\10\34\0\22\10\1\0\1\10\4\0\12\10"+ - "\1\205\10\10\34\0\4\10\1\206\15\10\1\0\1\10"+ - "\4\0\1\10\1\207\21\10\34\0\22\10\1\0\1\10"+ - "\4\0\12\10\1\210\10\10\34\0\20\10\1\211\1\10"+ - "\1\0\1\10\4\0\23\10\34\0\22\10\1\0\1\10"+ - "\4\0\1\212\22\10\34\0\22\10\1\0\1\10\4\0"+ - "\2\10\1\213\20\10\34\0\22\10\1\0\1\10\4\0"+ - "\6\10\1\214\4\10\1\215\7\10\34\0\22\10\1\0"+ - "\1\10\4\0\7\10\1\216\13\10\34\0\22\10\1\0"+ - "\1\10\4\0\2\10\1\217\20\10\34\0\20\10\1\220"+ - "\1\10\1\0\1\10\4\0\23\10\34\0\22\10\1\0"+ - "\1\10\4\0\5\10\1\221\15\10\34\0\22\10\1\0"+ - "\1\10\4\0\1\10\1\222\21\10\34\0\4\10\1\223"+ - "\15\10\1\0\1\10\4\0\23\10\34\0\22\10\1\0"+ - "\1\10\4\0\10\10\1\224\12\10\34\0\22\10\1\0"+ - "\1\10\4\0\12\10\1\225\10\10\126\0\1\226\106\0"+ - "\1\227\11\0\1\5\1\230\1\7\116\0\1\77\111\0"+ - "\1\77\105\0\1\77\77\0\2\166\1\73\6\166\1\0"+ - "\1\166\1\0\2\166\1\0\1\166\1\0\1\166\4\0"+ - "\1\166\2\0\1\166\1\0\1\166\2\0\1\73\1\166"+ - "\1\0\1\166\45\0\1\167\1\0\1\73\1\0\5\167"+ - "\3\0\1\167\21\0\1\73\50\0\1\170\1\0\1\73"+ - "\1\0\1\170\31\0\1\73\50\0\2\171\1\0\6\171"+ - "\3\0\1\171\2\0\1\77\21\0\1\77\45\0\2\171"+ - "\1\0\6\171\3\0\1\171\70\0\20\10\1\231\1\10"+ - "\1\0\1\10\4\0\23\10\34\0\22\10\1\0\1\10"+ - "\4\0\6\10\1\102\14\10\34\0\22\10\1\0\1\10"+ - "\4\0\1\232\22\10\34\0\22\10\1\0\1\10\4\0"+ - "\1\10\1\233\21\10\26\0\33\200\1\234\1\235\52\200"+ - "\34\201\1\236\1\237\51\201\6\0\22\10\1\0\1\10"+ - "\4\0\10\10\1\240\12\10\34\0\22\10\1\0\1\10"+ - "\4\0\10\10\1\241\12\10\34\0\22\10\1\0\1\10"+ - "\4\0\7\10\1\242\13\10\34\0\22\10\1\0\1\10"+ - "\4\0\13\10\1\243\7\10\34\0\22\10\1\0\1\10"+ - "\4\0\3\10\1\244\17\10\34\0\22\10\1\0\1\10"+ - "\4\0\7\10\1\245\13\10\34\0\22\10\1\0\1\10"+ - "\4\0\11\10\1\246\11\10\34\0\22\10\1\0\1\10"+ - "\4\0\1\10\1\247\21\10\34\0\22\10\1\0\1\10"+ - "\4\0\3\10\1\250\17\10\34\0\22\10\1\0\1\10"+ - "\4\0\3\10\1\251\17\10\34\0\22\10\1\0\1\10"+ - "\4\0\1\252\22\10\34\0\22\10\1\0\1\10\4\0"+ - "\2\10\1\253\20\10\34\0\22\10\1\0\1\10\4\0"+ - "\1\10\1\254\21\10\34\0\22\10\1\0\1\10\4\0"+ - "\6\10\1\255\14\10\34\0\22\10\1\0\1\10\4\0"+ - "\3\10\1\256\17\10\34\0\22\10\1\0\1\10\4\0"+ - "\3\10\1\257\17\10\31\0\1\5\1\6\1\7\107\0"+ - "\22\10\1\0\1\10\4\0\2\10\1\260\20\10\34\0"+ - "\22\10\1\0\1\10\4\0\4\10\1\261\16\10\34\0"+ - "\22\10\1\0\1\10\4\0\3\10\1\262\17\10\26\0"+ - "\33\200\1\263\1\235\161\200\143\201\1\236\1\264\51\201"+ - "\6\0\22\10\1\0\1\10\4\0\5\10\1\265\15\10"+ - "\34\0\22\10\1\0\1\10\4\0\2\10\1\266\20\10"+ - "\34\0\4\10\1\267\15\10\1\0\1\10\4\0\23\10"+ - "\34\0\4\10\1\270\15\10\1\0\1\10\4\0\23\10"+ - "\34\0\22\10\1\0\1\10\4\0\3\10\1\271\17\10"+ - "\34\0\22\10\1\0\1\10\4\0\1\10\1\272\21\10"+ - "\34\0\22\10\1\0\1\10\4\0\5\10\1\273\15\10"+ - "\34\0\22\10\1\0\1\10\4\0\2\10\1\274\20\10"+ - "\34\0\20\10\1\275\1\10\1\0\1\10\4\0\23\10"+ - "\34\0\22\10\1\0\1\10\4\0\3\10\1\276\17\10"+ - "\34\0\22\10\1\0\1\10\4\0\7\10\1\277\13\10"+ - "\26\0\33\200\1\177\1\235\52\200\34\201\1\236\1\177"+ - "\51\201\6\0\22\10\1\0\1\10\4\0\7\10\1\300"+ - "\13\10\34\0\22\10\1\0\1\10\4\0\12\10\1\301"+ - "\10\10\34\0\22\10\1\0\1\10\4\0\14\10\1\302"+ - "\6\10\34\0\22\10\1\0\1\10\4\0\12\10\1\303"+ - "\10\10\34\0\22\10\1\0\1\10\4\0\7\10\1\304"+ - "\13\10\34\0\22\10\1\0\1\10\4\0\1\10\1\305"+ - "\21\10\34\0\22\10\1\0\1\10\4\0\3\10\1\306"+ - "\17\10\34\0\22\10\1\0\1\10\4\0\10\10\1\307"+ - "\12\10\34\0\4\10\1\310\15\10\1\0\1\10\4\0"+ - "\23\10\34\0\22\10\1\0\1\10\4\0\13\10\1\311"+ - "\7\10\34\0\22\10\1\0\1\10\4\0\3\10\1\312"+ - "\17\10\34\0\22\10\1\0\1\10\4\0\22\10\1\313"+ - "\34\0\22\10\1\0\1\10\4\0\3\10\1\314\17\10"+ - "\34\0\22\10\1\0\1\10\4\0\3\10\1\315\17\10"+ - "\34\0\22\10\1\0\1\10\4\0\1\316\22\10\34\0"+ - "\22\10\1\0\1\10\4\0\7\10\1\317\13\10\34\0"+ - "\22\10\1\0\1\10\4\0\10\10\1\320\12\10\34\0"+ - "\22\10\1\0\1\10\4\0\2\10\1\321\20\10\34\0"+ - "\22\10\1\0\1\10\4\0\3\10\1\322\17\10\26\0"; - - private static int [] zzUnpackTrans() { - int [] result = new int[11005]; + "\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\24\1\25\10\26\1\27\1\30\1\31"+ + "\1\32\1\33\1\34\3\35\1\36\1\35\1\37\1\35"+ + "\1\40\1\35\1\41\1\2\1\42\1\43\1\2\1\44"+ + "\1\45\1\46\1\47\1\50\1\51\1\35\1\52\2\35"+ + "\1\53\1\54\1\55\1\56\1\57\1\60\1\35\1\61"+ + "\1\35\1\62\1\63\1\64\1\65\1\66\111\0\1\3"+ + "\2\0\1\3\2\0\1\11\102\0\1\4\106\0\1\3"+ + "\2\0\1\67\2\0\1\11\137\0\1\70\50\0\2\71"+ + "\2\0\2\71\1\72\45\71\1\73\33\71\2\11\1\74"+ + "\1\75\104\11\37\0\1\76\107\0\1\77\50\0\2\100"+ + "\2\0\6\100\1\101\41\100\1\102\33\100\37\0\1\103"+ + "\107\0\1\104\107\0\1\105\1\106\72\0\11\107\113\0"+ + "\1\110\71\0\1\107\1\0\11\111\7\0\1\112\1\113"+ + "\1\114\2\0\1\115\1\0\1\116\6\0\1\112\2\0"+ + "\1\113\1\114\1\0\1\117\4\0\1\115\4\0\1\117"+ + "\27\0\1\107\1\0\11\26\10\0\1\113\1\114\16\0"+ + "\1\113\1\114\1\0\1\117\11\0\1\117\44\0\1\120"+ + "\1\70\107\0\1\70\1\121\72\0\11\35\6\0\11\35"+ + "\4\0\25\35\27\0\11\35\6\0\11\35\4\0\1\35"+ + "\1\122\23\35\27\0\11\35\6\0\11\35\4\0\15\35"+ + "\1\123\7\35\27\0\11\35\6\0\11\35\4\0\17\35"+ + "\1\124\5\35\43\0\1\125\73\0\11\35\6\0\11\35"+ + "\4\0\14\35\1\126\3\35\1\127\4\35\27\0\11\35"+ + "\6\0\11\35\4\0\15\35\1\130\1\35\1\131\5\35"+ + "\27\0\11\35\6\0\11\35\4\0\3\35\1\132\6\35"+ + "\1\133\2\35\1\134\7\35\27\0\11\35\6\0\11\35"+ + "\4\0\5\35\1\135\2\35\1\136\14\35\27\0\11\35"+ + "\6\0\11\35\4\0\12\35\1\137\1\35\1\140\10\35"+ + "\27\0\3\35\1\141\2\35\1\142\2\35\6\0\11\35"+ + "\4\0\12\35\1\143\2\35\1\144\7\35\27\0\1\35"+ + "\1\145\1\35\1\141\2\35\1\142\1\146\1\35\6\0"+ + "\11\35\4\0\6\35\1\147\4\35\1\150\1\151\10\35"+ + "\27\0\11\35\6\0\11\35\4\0\1\35\1\152\23\35"+ + "\27\0\11\35\6\0\11\35\4\0\15\35\1\153\7\35"+ + "\27\0\11\35\6\0\11\35\4\0\17\35\1\154\5\35"+ + "\27\0\11\35\6\0\11\35\4\0\1\35\1\155\23\35"+ + "\27\0\11\35\6\0\11\35\4\0\5\35\1\156\14\35"+ + "\1\157\2\35\27\0\11\35\6\0\11\35\4\0\17\35"+ + "\1\146\1\35\1\160\3\35\27\0\1\35\1\145\1\35"+ + "\1\141\2\35\1\142\1\146\1\35\6\0\11\35\4\0"+ + "\25\35\27\0\11\35\6\0\11\35\4\0\7\35\1\161"+ + "\15\35\43\0\1\162\51\0\1\3\2\0\1\163\2\0"+ + "\1\11\100\0\2\71\2\0\2\71\1\164\45\71\1\73"+ + "\33\71\6\0\1\165\101\0\110\71\2\0\1\74\105\0"+ + "\2\100\2\0\6\100\1\164\41\100\1\102\33\100\12\0"+ + "\1\166\75\0\110\100\23\0\11\107\10\0\1\113\1\114"+ + "\16\0\1\113\1\114\43\0\1\107\1\0\11\111\10\0"+ + "\1\113\1\114\16\0\1\113\1\114\45\0\2\167\101\0"+ + "\1\170\1\0\1\170\2\0\11\171\77\0\7\172\101\0"+ + "\11\173\6\0\4\173\12\0\6\173\46\0\1\174\1\0"+ + "\1\175\2\0\1\176\1\114\114\0\1\177\107\0\1\200"+ + "\73\0\11\35\6\0\11\35\4\0\12\35\1\201\12\35"+ + "\27\0\11\35\6\0\11\35\4\0\14\35\1\202\10\35"+ + "\27\0\11\35\6\0\11\35\4\0\22\35\1\203\2\35"+ + "\27\0\11\35\6\0\11\35\4\0\4\35\1\204\20\35"+ + "\27\0\11\35\6\0\11\35\4\0\15\35\1\205\7\35"+ + "\27\0\11\35\6\0\11\35\4\0\5\35\1\206\17\35"+ + "\27\0\11\35\6\0\11\35\4\0\15\35\1\207\7\35"+ + "\27\0\11\35\6\0\11\35\4\0\1\35\1\210\23\35"+ + "\27\0\11\35\6\0\11\35\4\0\14\35\1\211\10\35"+ + "\27\0\11\35\6\0\11\35\4\0\6\35\1\212\3\35"+ + "\1\213\12\35\27\0\11\35\6\0\11\35\4\0\17\35"+ + "\1\214\5\35\27\0\11\35\6\0\11\35\4\0\10\35"+ + "\1\215\7\35\1\216\4\35\27\0\11\35\6\0\11\35"+ + "\4\0\22\35\1\217\2\35\27\0\2\35\1\146\6\35"+ + "\6\0\11\35\4\0\25\35\27\0\4\35\1\146\4\35"+ + "\6\0\11\35\4\0\25\35\27\0\11\35\6\0\11\35"+ + "\4\0\15\35\1\220\7\35\27\0\11\35\6\0\11\35"+ + "\4\0\17\35\1\221\5\35\27\0\6\35\1\146\2\35"+ + "\6\0\11\35\4\0\25\35\27\0\11\35\6\0\11\35"+ + "\4\0\16\35\1\222\6\35\27\0\11\35\6\0\11\35"+ + "\4\0\21\35\1\146\3\35\27\0\11\35\6\0\11\35"+ + "\4\0\3\35\1\223\21\35\27\0\11\35\6\0\11\35"+ + "\4\0\21\35\1\224\3\35\27\0\11\35\6\0\11\35"+ + "\4\0\20\35\1\225\4\35\27\0\11\35\6\0\11\35"+ + "\4\0\21\35\1\226\3\35\27\0\11\35\6\0\11\35"+ + "\4\0\14\35\1\227\10\35\27\0\11\35\6\0\11\35"+ + "\4\0\17\35\1\230\5\35\27\0\11\35\6\0\11\35"+ + "\4\0\10\35\1\231\14\35\5\0\1\3\2\0\1\232"+ + "\2\0\1\11\100\0\6\165\1\233\45\165\1\234\33\165"+ + "\12\166\1\235\41\166\1\236\33\166\23\0\2\167\42\0"+ + "\1\117\11\0\1\117\31\0\11\171\77\0\11\171\11\0"+ + "\1\114\17\0\1\114\45\0\7\172\35\0\1\117\11\0"+ + "\1\117\31\0\11\173\6\0\4\173\12\0\6\173\1\0"+ + "\1\117\11\0\1\117\37\0\1\114\103\0\1\114\111\0"+ + "\1\114\103\0\11\35\6\0\11\35\4\0\20\35\1\237"+ + "\4\35\27\0\11\35\6\0\11\35\4\0\5\35\1\240"+ + "\17\35\27\0\11\35\6\0\11\35\4\0\5\35\1\241"+ + "\17\35\27\0\11\35\6\0\11\35\4\0\12\35\1\146"+ + "\12\35\27\0\11\35\6\0\11\35\4\0\1\35\1\242"+ + "\23\35\27\0\11\35\6\0\11\35\4\0\4\35\1\243"+ + "\20\35\27\0\11\35\6\0\11\35\4\0\20\35\1\244"+ + "\4\35\27\0\11\35\6\0\11\35\4\0\21\35\1\245"+ + "\3\35\27\0\11\35\6\0\11\35\4\0\5\35\1\246"+ + "\17\35\27\0\11\35\6\0\11\35\4\0\5\35\1\247"+ + "\17\35\27\0\11\35\6\0\11\35\4\0\6\35\1\250"+ + "\16\35\27\0\11\35\6\0\11\35\4\0\5\35\1\251"+ + "\17\35\27\0\11\35\6\0\11\35\4\0\13\35\1\252"+ + "\11\35\27\0\11\35\6\0\11\35\4\0\1\35\1\253"+ + "\23\35\27\0\11\35\6\0\11\35\4\0\15\35\1\254"+ + "\7\35\27\0\11\35\6\0\11\35\4\0\17\35\1\255"+ + "\5\35\27\0\11\35\6\0\11\35\4\0\20\35\1\256"+ + "\4\35\27\0\11\35\6\0\11\35\4\0\22\35\1\257"+ + "\2\35\27\0\11\35\6\0\11\35\4\0\21\35\1\260"+ + "\3\35\27\0\11\35\6\0\11\35\4\0\22\35\1\261"+ + "\2\35\27\0\11\35\6\0\11\35\4\0\12\35\1\262"+ + "\12\35\5\0\1\3\2\0\1\6\2\0\1\11\100\0"+ + "\6\165\1\263\45\165\1\234\143\165\12\166\1\264\41\166"+ + "\1\236\143\166\23\0\11\35\6\0\11\35\4\0\5\35"+ + "\1\265\17\35\27\0\11\35\6\0\11\35\4\0\11\35"+ + "\1\266\13\35\27\0\11\35\6\0\11\35\4\0\5\35"+ + "\1\267\17\35\27\0\11\35\6\0\11\35\4\0\20\35"+ + "\1\270\4\35\27\0\11\35\6\0\11\35\4\0\10\35"+ + "\1\271\14\35\27\0\11\35\6\0\11\35\4\0\17\35"+ + "\1\272\5\35\27\0\11\35\6\0\11\35\4\0\3\35"+ + "\1\273\21\35\27\0\11\35\6\0\11\35\4\0\17\35"+ + "\1\274\5\35\27\0\11\35\6\0\11\35\4\0\15\35"+ + "\1\275\7\35\27\0\11\35\6\0\11\35\4\0\17\35"+ + "\1\276\5\35\27\0\11\35\6\0\11\35\4\0\10\35"+ + "\1\277\14\35\27\0\11\35\6\0\11\35\4\0\3\35"+ + "\1\300\21\35\27\0\11\35\6\0\11\35\4\0\5\35"+ + "\1\301\17\35\4\0\6\165\1\164\45\165\1\234\33\165"+ + "\12\166\1\164\41\166\1\236\33\166\23\0\11\35\6\0"+ + "\11\35\4\0\14\35\1\302\10\35\27\0\11\35\6\0"+ + "\11\35\4\0\21\35\1\303\3\35\27\0\11\35\6\0"+ + "\11\35\4\0\21\35\1\304\3\35\27\0\11\35\6\0"+ + "\11\35\4\0\20\35\1\305\4\35\27\0\11\35\6\0"+ + "\11\35\4\0\14\35\1\306\10\35\27\0\11\35\6\0"+ + "\11\35\4\0\13\35\1\307\11\35\27\0\11\35\6\0"+ + "\11\35\4\0\21\35\1\310\3\35\27\0\11\35\6\0"+ + "\11\35\4\0\22\35\1\311\2\35\27\0\11\35\6\0"+ + "\11\35\4\0\10\35\1\312\14\35\27\0\11\35\6\0"+ + "\11\35\4\0\5\35\1\313\17\35\27\0\11\35\6\0"+ + "\11\35\4\0\5\35\1\314\17\35\27\0\11\35\6\0"+ + "\11\35\4\0\23\35\1\315\1\35\27\0\11\35\6\0"+ + "\11\35\4\0\6\35\1\316\16\35\27\0\11\35\6\0"+ + "\11\35\4\0\5\35\1\317\17\35\27\0\11\35\6\0"+ + "\11\35\4\0\5\35\1\320\17\35\27\0\11\35\6\0"+ + "\11\35\4\0\1\35\1\321\23\35\27\0\11\35\6\0"+ + "\11\35\4\0\21\35\1\322\3\35\27\0\11\35\6\0"+ + "\11\35\4\0\22\35\1\323\2\35\27\0\11\35\6\0"+ + "\11\35\4\0\17\35\1\324\5\35\27\0\11\35\6\0"+ + "\11\35\4\0\5\35\1\325\17\35\4\0"; + + private static int [] zzUnpacktrans() { + int [] result = new int[11304]; int offset = 0; - offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + offset = zzUnpacktrans(ZZ_TRANS_PACKED_0, offset, result); return result; } - private static int zzUnpackTrans(String packed, int offset, int [] 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(); @@ -341,19 +375,20 @@ private static int zzUnpackTrans(String packed, int offset, int [] result) { }; /** - * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + * ZZ_ATTRIBUTE[aState] contains the attributes of state {@code aState} */ private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); private static final String ZZ_ATTRIBUTE_PACKED_0 = - "\1\0\1\11\1\1\1\11\34\1\6\11\13\1\5\11"+ - "\2\1\1\11\1\1\4\0\1\11\1\1\1\0\13\1"+ - "\1\11\31\1\2\11\1\1\4\11\1\1\3\11\1\1"+ - "\3\0\4\1\1\0\4\1\1\11\26\1\2\11\4\1"+ - "\4\0\23\1\2\0\36\1"; + "\1\0\1\11\1\1\1\11\10\1\2\11\2\1\1\11"+ + "\5\1\2\11\3\1\1\11\4\1\2\11\20\1\1\11"+ + "\1\1\2\11\1\1\1\11\3\1\1\11\1\1\2\11"+ + "\3\1\4\11\1\1\1\11\1\1\2\0\1\11\3\0"+ + "\5\1\1\11\34\1\1\11\1\1\1\11\3\1\1\0"+ + "\3\1\3\0\2\11\32\1\4\0\24\1\2\0\41\1"; private static int [] zzUnpackAttribute() { - int [] result = new int[210]; + int [] result = new int[213]; int offset = 0; offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); return result; @@ -397,15 +432,27 @@ the source of the yytext() string */ 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 */ + /** Number of newlines encountered up to the start of the matched text. */ + @SuppressWarnings("unused") + private int yyline; + + /** Number of characters from the last newline up to the start of the matched text. */ + @SuppressWarnings("unused") + protected int yycolumn; + + /** Number of characters up to the start of the matched text. */ + @SuppressWarnings("unused") + private long yychar; + + /** Whether the scanner is currently at the beginning of a line. */ + @SuppressWarnings("unused") + private boolean zzAtBOL = true; + + /** Whether the user-EOF-code has already been executed. */ + @SuppressWarnings("unused") private boolean zzEOFDone; @@ -419,26 +466,22 @@ the source of the yytext() string */ } - /** - * Unpacks the compressed character translation table. - * - * @param packed the packed character translation table - * @return the unpacked character translation table + /** Returns the maximum size of the scanner buffer, which limits the size of tokens. */ + private int zzMaxBufferLen() { + return Integer.MAX_VALUE; + } + + /** Whether the scanner buffer can grow to accommodate a larger token. */ + private boolean zzCanGrow() { + return true; + } + + /** + * Translates raw input code points to DFA table row */ - 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; + private static int zzCMap(int input) { + int offset = input & 255; + return offset == input ? ZZ_CMAP_BLOCKS[offset] : ZZ_CMAP_BLOCKS[ZZ_CMAP_TOP[input >> 8] | offset]; } public final int getTokenStart() { @@ -570,7 +613,8 @@ public void yypushback(int number) { * @return the next token * @exception java.io.IOException if any I/O-Error occurs */ - public IElementType advance() throws java.io.IOException { + public IElementType advance() throws java.io.IOException + { int zzInput; int zzAction; @@ -604,7 +648,7 @@ public IElementType advance() throws java.io.IOException { while (true) { if (zzCurrentPosL < zzEndReadL) { - zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL/*, zzEndReadL*/); + zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL); zzCurrentPosL += Character.charCount(zzInput); } else if (zzAtEOF) { @@ -626,11 +670,11 @@ else if (zzAtEOF) { break zzForAction; } else { - zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL/*, zzEndReadL*/); + zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL); zzCurrentPosL += Character.charCount(zzInput); } } - int zzNext = zzTransL[ zzRowMapL[zzState] + ZZ_CMAP(zzInput) ]; + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMap(zzInput) ]; if (zzNext == -1) break zzForAction; zzState = zzNext; @@ -653,366 +697,371 @@ else if (zzAtEOF) { } else { switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { - case 1: + case 1: { return TokenType.BAD_CHARACTER; - } - // fall through - case 73: break; - case 2: - { return YakshaTypes.NL; - } - // fall through + } + // fall through case 74: break; - case 3: + case 2: { return YakshaTypes.S; - } - // fall through + } + // fall through case 75: break; - case 4: - { return YakshaTypes.COMMENT; - } - // fall through + case 3: + { return YakshaTypes.NL; + } + // fall through case 76: break; - case 5: - { return YakshaTypes.IDENTIFIER; - } - // fall through + case 4: + { return YakshaTypes.OPERATOR_NOT_SYMBOL; + } + // fall through case 77: break; - case 6: - { return YakshaTypes.NUMBER; - } - // fall through + case 5: + { return YakshaTypes.STRING; + } + // fall through case 78: break; - case 7: - { return YakshaTypes.OPERATOR_DOT; - } - // fall through + case 6: + { return YakshaTypes.COMMENT; + } + // fall through case 79: break; - case 8: - { return YakshaTypes.OPERATOR_PLUS; - } - // fall through + case 7: + { return YakshaTypes.OPERATOR_REMAINDER; + } + // fall through case 80: break; - case 9: - { return YakshaTypes.STRING; - } - // fall through + case 8: + { return YakshaTypes.OPERATOR_B_AND; + } + // fall through case 81: break; - case 10: + case 9: { return YakshaTypes.OPERATOR_OPEN_P; - } - // fall through + } + // fall through case 82: break; - case 11: + case 10: { return YakshaTypes.OPERATOR_CLOSE_P; - } - // fall through + } + // fall through case 83: break; - case 12: - { return YakshaTypes.OPERATOR_OPEN_SQB; - } - // fall through + case 11: + { return YakshaTypes.OPERATOR_MUL; + } + // fall through case 84: break; - case 13: - { return YakshaTypes.OPERATOR_CLOSE_SQB; - } - // fall through + case 12: + { return YakshaTypes.OPERATOR_PLUS; + } + // fall through case 85: break; - case 14: - { return YakshaTypes.OPERATOR_CURLY_OPEN; - } - // fall through + case 13: + { return YakshaTypes.OPERATOR_COMMA; + } + // fall through case 86: break; - case 15: - { return YakshaTypes.OPERATOR_CURLY_CLOSE; - } - // fall through - case 87: break; - case 16: + case 14: { return YakshaTypes.OPERATOR_MINUS; - } - // fall through + } + // fall through + case 87: break; + case 15: + { return YakshaTypes.OPERATOR_DOT; + } + // fall through case 88: break; - case 17: - { return YakshaTypes.OPERATOR_COMPARISON; - } - // fall through + case 16: + { return YakshaTypes.OPERATOR_DIV; + } + // fall through case 89: break; - case 18: - { return YakshaTypes.OPERATOR_MUL; - } - // fall through + case 17: + { return YakshaTypes.NUMBER; + } + // fall through case 90: break; - case 19: - { return YakshaTypes.OPERATOR_DIV; - } - // fall through + case 18: + { return YakshaTypes.OPERATOR_COLON; + } + // fall through case 91: break; - case 20: - { return YakshaTypes.OPERATOR_REMAINDER; - } - // fall through + case 19: + { return YakshaTypes.OPERATOR_SEMICOLON; + } + // fall through case 92: break; - case 21: - { return YakshaTypes.OPERATOR_B_AND; - } - // fall through + case 20: + { return YakshaTypes.OPERATOR_COMPARISON; + } + // fall through case 93: break; - case 22: - { return YakshaTypes.OPERATOR_B_OR; - } - // fall through + case 21: + { return YakshaTypes.OPERATOR_EQ; + } + // fall through case 94: break; - case 23: - { return YakshaTypes.OPERATOR_B_XOR; - } - // fall through + case 22: + { return YakshaTypes.OPERATOR_AT; + } + // fall through case 95: break; - case 24: - { return YakshaTypes.OPERATOR_EQ; - } - // fall through + case 23: + { return YakshaTypes.IDENTIFIER; + } + // fall through case 96: break; - case 25: - { return YakshaTypes.OPERATOR_NOT_SYMBOL; - } - // fall through + case 24: + { return YakshaTypes.OPERATOR_OPEN_SQB; + } + // fall through case 97: break; - case 26: - { return YakshaTypes.OPERATOR_AT; - } - // fall through + case 25: + { return YakshaTypes.OPERATOR_CLOSE_SQB; + } + // fall through case 98: break; - case 27: - { return YakshaTypes.OPERATOR_COLON; - } - // fall through + case 26: + { return YakshaTypes.OPERATOR_B_XOR; + } + // fall through case 99: break; - case 28: - { return YakshaTypes.OPERATOR_COMMA; - } - // fall through + case 27: + { return YakshaTypes.OPERATOR_CURLY_OPEN; + } + // fall through case 100: break; - case 29: - { return YakshaTypes.OPERATOR_SEMICOLON; - } - // fall through + case 28: + { return YakshaTypes.OPERATOR_B_OR; + } + // fall through case 101: break; - case 30: - { return YakshaTypes.OPERATOR_B_NOT; - } - // fall through + case 29: + { return YakshaTypes.OPERATOR_CURLY_CLOSE; + } + // fall through case 102: break; - case 31: - { return YakshaTypes.PRIMITIVE_DATA_TYPE; - } - // fall through + case 30: + { return YakshaTypes.OPERATOR_B_NOT; + } + // fall through case 103: break; - case 32: - { return YakshaTypes.KW_IN; - } - // fall through + case 31: + { return YakshaTypes.OPERATOR_REMAINDER_EQ; + } + // fall through case 104: break; - case 33: - { return YakshaTypes.KW_IF; - } - // fall through + case 32: + { return YakshaTypes.OPERATOR_B_AND_EQ; + } + // fall through case 105: break; - case 34: - { return YakshaTypes.OPERATOR_OR; - } - // fall through + case 33: + { return YakshaTypes.OPERATOR_MUL_EQ; + } + // fall through case 106: break; - case 35: + case 34: { return YakshaTypes.OPERATOR_PLUS_EQ; - } - // fall through + } + // fall through case 107: break; - case 36: - { return YakshaTypes.KW_AS; - } - // fall through + case 35: + { return YakshaTypes.OPERATOR_MINUS_EQ; + } + // fall through case 108: break; - case 37: + case 36: { return YakshaTypes.OPERATOR_ARROW; - } - // fall through + } + // fall through case 109: break; - case 38: - { return YakshaTypes.OPERATOR_MINUS_EQ; - } - // fall through + case 37: + { return YakshaTypes.OPERATOR_DIV_EQ; + } + // fall through case 110: break; - case 39: - { return YakshaTypes.OPERATOR_SHR; - } - // fall through + case 38: + { return YakshaTypes.OPERATOR_SHL; + } + // fall through case 111: break; - case 40: - { return YakshaTypes.OPERATOR_MUL_EQ; - } - // fall through + case 39: + { return YakshaTypes.OPERATOR_SHR; + } + // fall through case 112: break; - case 41: - { return YakshaTypes.OPERATOR_DIV_EQ; - } - // fall through + case 40: + { return YakshaTypes.OPERATOR_B_XOR_EQ; + } + // fall through case 113: break; - case 42: - { return YakshaTypes.OPERATOR_REMAINDER_EQ; - } - // fall through + case 41: + { return YakshaTypes.KW_AS; + } + // fall through case 114: break; - case 43: - { return YakshaTypes.OPERATOR_SHL; - } - // fall through + case 42: + { return YakshaTypes.PRIMITIVE_DATA_TYPE; + } + // fall through case 115: break; - case 44: - { return YakshaTypes.OPERATOR_B_AND_EQ; - } - // fall through + case 43: + { return YakshaTypes.KW_IF; + } + // fall through case 116: break; - case 45: - { return YakshaTypes.OPERATOR_B_OR_EQ; - } - // fall through + case 44: + { return YakshaTypes.KW_IN; + } + // fall through case 117: break; - case 46: - { return YakshaTypes.OPERATOR_B_XOR_EQ; - } - // fall through + case 45: + { return YakshaTypes.OPERATOR_OR; + } + // fall through case 118: break; - case 47: - { return YakshaTypes.OPERATOR_AND; - } - // fall through + case 46: + { return YakshaTypes.OPERATOR_B_OR_EQ; + } + // fall through case 119: break; - case 48: - { return YakshaTypes.KW_DEL; - } - // fall through + case 47: + { return YakshaTypes.OPERATOR_SHL_EQ; + } + // fall through case 120: break; - case 49: - { return YakshaTypes.KW_DEF; - } - // fall through + case 48: + { return YakshaTypes.OPERATOR_SHR_EQ; + } + // fall through case 121: break; - case 50: - { return YakshaTypes.OPERATOR_NOT; - } - // fall through + case 49: + { return YakshaTypes.OPERATOR_AND; + } + // fall through case 122: break; - case 51: - { return YakshaTypes.KW_FOR; - } - // fall through + case 50: + { return YakshaTypes.KW_DEF; + } + // fall through case 123: break; - case 52: - { return YakshaTypes.OPERATOR_SHR_EQ; - } - // fall through + case 51: + { return YakshaTypes.KW_DEL; + } + // fall through case 124: break; - case 53: - { return YakshaTypes.OPERATOR_SHL_EQ; - } - // fall through + case 52: + { return YakshaTypes.KW_FOR; + } + // fall through case 125: break; - case 54: - { return YakshaTypes.I; - } - // fall through + case 53: + { return YakshaTypes.OPERATOR_NOT; + } + // fall through case 126: break; - case 55: - { return YakshaTypes.KW_ELIF; - } - // fall through + case 54: + { return YakshaTypes.I; + } + // fall through case 127: break; - case 56: - { return YakshaTypes.KW_ELSE; - } - // fall through + case 55: + { return YakshaTypes.KW_NONE; + } + // fall through case 128: break; - case 57: - { return YakshaTypes.KW_PASS; - } - // fall through - case 129: break; - case 58: + case 56: { return YakshaTypes.KW_TRUE; - } - // fall through + } + // fall through + case 129: break; + case 57: + { return YakshaTypes.KW_ELIF; + } + // fall through case 130: break; - case 59: - { return YakshaTypes.KW_NONE; - } - // fall through + case 58: + { return YakshaTypes.KW_ELSE; + } + // fall through case 131: break; - case 60: - { return YakshaTypes.KW_BREAK; - } - // fall through + case 59: + { return YakshaTypes.KW_ENUM; + } + // fall through case 132: break; - case 61: - { return YakshaTypes.KW_FALSE; - } - // fall through + case 60: + { return YakshaTypes.KW_PASS; + } + // fall through case 133: break; - case 62: - { return YakshaTypes.KW_CCODE; - } - // fall through + case 61: + { return YakshaTypes.KW_FALSE; + } + // fall through case 134: break; - case 63: - { return YakshaTypes.KW_CLASS; - } - // fall through + case 62: + { return YakshaTypes.KW_BREAK; + } + // fall through case 135: break; - case 64: - { return YakshaTypes.KW_DEFER; - } - // fall through + case 63: + { return YakshaTypes.KW_CCODE; + } + // fall through case 136: break; - case 65: - { return YakshaTypes.KW_WHILE; - } - // fall through + case 64: + { return YakshaTypes.KW_CLASS; + } + // fall through case 137: break; - case 66: - { return YakshaTypes.KW_IMPORT; - } - // fall through + case 65: + { return YakshaTypes.KW_DEFER; + } + // fall through case 138: break; - case 67: - { return YakshaTypes.KW_STRUCT; - } - // fall through + case 66: + { return YakshaTypes.KW_WHILE; + } + // fall through case 139: break; - case 68: - { return YakshaTypes.KW_RETURN; - } - // fall through + case 67: + { return YakshaTypes.KW_IMPORT; + } + // fall through case 140: break; - case 69: + case 68: { return YakshaTypes.KW_MACROS; - } - // fall through + } + // fall through case 141: break; - case 70: - { return YakshaTypes.KW_CONTINUE; - } - // fall through + case 69: + { return YakshaTypes.KW_RETURN; + } + // fall through case 142: break; - case 71: - { return YakshaTypes.KW_DIRECTIVE; - } - // fall through + case 70: + { return YakshaTypes.KW_STRUCT; + } + // fall through case 143: break; - case 72: - { return YakshaTypes.KW_RUNTIMEFEATURE; - } - // fall through + case 71: + { return YakshaTypes.KW_CONTINUE; + } + // fall through case 144: break; + case 72: + { return YakshaTypes.KW_DIRECTIVE; + } + // fall through + case 145: break; + case 73: + { return YakshaTypes.KW_RUNTIMEFEATURE; + } + // fall through + case 146: break; default: zzScanError(ZZ_NO_MATCH); } diff --git a/editor/intellij/src/main/gen/org/intellij/sdk/language/parser/YakshaParser.java b/editor/intellij/src/main/gen/org/intellij/sdk/language/parser/YakshaParser.java index f6529a0e..34e62f5b 100644 --- a/editor/intellij/src/main/gen/org/intellij/sdk/language/parser/YakshaParser.java +++ b/editor/intellij/src/main/gen/org/intellij/sdk/language/parser/YakshaParser.java @@ -1747,6 +1747,122 @@ private static boolean empty_line_0(PsiBuilder b, int l) { return true; } + /* ********************************************************** */ + // COMMENT | empty_line | enum_field + public static boolean enum_bits(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "enum_bits")) return false; + boolean r; + Marker m = enter_section_(b, l, _NONE_, ENUM_BITS, ""); + r = consumeToken(b, COMMENT); + if (!r) r = empty_line(b, l + 1); + if (!r) r = enum_field(b, l + 1); + exit_section_(b, l, m, r, false, null); + return r; + } + + /* ********************************************************** */ + // enum_field_wo_indent | NL enum_bits+ + public static boolean enum_block(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "enum_block")) return false; + if (!nextTokenIs(b, "", IDENTIFIER, NL)) return false; + boolean r; + Marker m = enter_section_(b, l, _NONE_, ENUM_BLOCK, ""); + r = enum_field_wo_indent(b, l + 1); + if (!r) r = enum_block_1(b, l + 1); + exit_section_(b, l, m, r, false, null); + return r; + } + + // NL enum_bits+ + private static boolean enum_block_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "enum_block_1")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, NL); + r = r && enum_block_1_1(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + // enum_bits+ + private static boolean enum_block_1_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "enum_block_1_1")) return false; + boolean r; + Marker m = enter_section_(b); + r = enum_bits(b, l + 1); + while (r) { + int c = current_position_(b); + if (!enum_bits(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "enum_block_1_1", c)) break; + } + exit_section_(b, m, null, r); + return r; + } + + /* ********************************************************** */ + // I enum_field_wo_indent + public static boolean enum_field(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "enum_field")) return false; + if (!nextTokenIs(b, I)) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, I); + r = r && enum_field_wo_indent(b, l + 1); + exit_section_(b, m, ENUM_FIELD, r); + return r; + } + + /* ********************************************************** */ + // IDENTIFIER S? NL + public static boolean enum_field_wo_indent(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "enum_field_wo_indent")) return false; + if (!nextTokenIs(b, IDENTIFIER)) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, IDENTIFIER); + r = r && enum_field_wo_indent_1(b, l + 1); + r = r && consumeToken(b, NL); + exit_section_(b, m, ENUM_FIELD_WO_INDENT, r); + return r; + } + + // S? + private static boolean enum_field_wo_indent_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "enum_field_wo_indent_1")) return false; + consumeToken(b, S); + return true; + } + + /* ********************************************************** */ + // KW_ENUM S IDENTIFIER S? OPERATOR_COLON S? enum_block + public static boolean enum_statement(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "enum_statement")) return false; + if (!nextTokenIs(b, KW_ENUM)) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeTokens(b, 0, KW_ENUM, S, IDENTIFIER); + r = r && enum_statement_3(b, l + 1); + r = r && consumeToken(b, OPERATOR_COLON); + r = r && enum_statement_5(b, l + 1); + r = r && enum_block(b, l + 1); + exit_section_(b, m, ENUM_STATEMENT, r); + return r; + } + + // S? + private static boolean enum_statement_3(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "enum_statement_3")) return false; + consumeToken(b, S); + return true; + } + + // S? + private static boolean enum_statement_5(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "enum_statement_5")) return false; + consumeToken(b, S); + return true; + } + /* ********************************************************** */ // S? logic_or S? public static boolean exp(PsiBuilder b, int l) { @@ -2843,7 +2959,7 @@ private static boolean macro_declaration_statement_6(PsiBuilder b, int l) { } /* ********************************************************** */ - // directive_statement | runtimefeature_statement | import_statement | const_statement | annotation* class_statement | annotation* def_statement | macro_declaration_statement | dsl_outer_block + // directive_statement | runtimefeature_statement | import_statement | const_statement | annotation* class_statement | annotation* def_statement | enum_statement | macro_declaration_statement | dsl_outer_block public static boolean outer_statement(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "outer_statement")) return false; boolean r; @@ -2854,6 +2970,7 @@ public static boolean outer_statement(PsiBuilder b, int l) { if (!r) r = const_statement(b, l + 1); if (!r) r = outer_statement_4(b, l + 1); if (!r) r = outer_statement_5(b, l + 1); + if (!r) r = enum_statement(b, l + 1); if (!r) r = macro_declaration_statement(b, l + 1); if (!r) r = dsl_outer_block(b, l + 1); exit_section_(b, l, m, r, false, null); @@ -3241,7 +3358,7 @@ private static boolean term_0_1_0_2(PsiBuilder b, int l) { } /* ********************************************************** */ - // !('@' | 'class' | 'struct' | 'def' | 'import' | 'runtimefeature' | 'macros' | 'directive') + // !('@' | 'class' | 'struct' | 'enum' | 'def' | 'import' | 'runtimefeature' | 'macros' | 'directive') static boolean top_level_recover(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "top_level_recover")) return false; boolean r; @@ -3251,13 +3368,14 @@ static boolean top_level_recover(PsiBuilder b, int l) { return r; } - // '@' | 'class' | 'struct' | 'def' | 'import' | 'runtimefeature' | 'macros' | 'directive' + // '@' | 'class' | 'struct' | 'enum' | 'def' | 'import' | 'runtimefeature' | 'macros' | 'directive' private static boolean top_level_recover_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "top_level_recover_0")) return false; boolean r; r = consumeToken(b, "@"); if (!r) r = consumeToken(b, "class"); if (!r) r = consumeToken(b, "struct"); + if (!r) r = consumeToken(b, "enum"); if (!r) r = consumeToken(b, "def"); if (!r) r = consumeToken(b, "import"); if (!r) r = consumeToken(b, "runtimefeature"); diff --git a/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaEnumBits.java b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaEnumBits.java new file mode 100644 index 00000000..80e4e053 --- /dev/null +++ b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaEnumBits.java @@ -0,0 +1,16 @@ +// This is a generated file. Not intended for manual editing. +package org.intellij.sdk.language.psi; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.psi.PsiElement; + +public interface YakshaEnumBits extends PsiElement { + + @Nullable + YakshaEmptyLine getEmptyLine(); + + @Nullable + YakshaEnumField getEnumField(); + +} diff --git a/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaEnumBlock.java b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaEnumBlock.java new file mode 100644 index 00000000..f3664f81 --- /dev/null +++ b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaEnumBlock.java @@ -0,0 +1,16 @@ +// This is a generated file. Not intended for manual editing. +package org.intellij.sdk.language.psi; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.psi.PsiElement; + +public interface YakshaEnumBlock extends PsiElement { + + @NotNull + List getEnumBitsList(); + + @Nullable + YakshaEnumFieldWoIndent getEnumFieldWoIndent(); + +} diff --git a/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaEnumField.java b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaEnumField.java new file mode 100644 index 00000000..3b1d2c8c --- /dev/null +++ b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaEnumField.java @@ -0,0 +1,25 @@ +// This is a generated file. Not intended for manual editing. +package org.intellij.sdk.language.psi; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.psi.PsiElement; + +public interface YakshaEnumField extends PsiElement { + + @NotNull + YakshaEnumFieldWoIndent getEnumFieldWoIndent(); + + //WARNING: getName(...) is skipped + //matching getName(YakshaEnumField, ...) + //methods are not found in YakshaPsiImplUtil + + //WARNING: getNameIdentifier(...) is skipped + //matching getNameIdentifier(YakshaEnumField, ...) + //methods are not found in YakshaPsiImplUtil + + //WARNING: getPresentation(...) is skipped + //matching getPresentation(YakshaEnumField, ...) + //methods are not found in YakshaPsiImplUtil + +} diff --git a/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaEnumFieldWoIndent.java b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaEnumFieldWoIndent.java new file mode 100644 index 00000000..1c83caf9 --- /dev/null +++ b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaEnumFieldWoIndent.java @@ -0,0 +1,22 @@ +// This is a generated file. Not intended for manual editing. +package org.intellij.sdk.language.psi; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.psi.PsiElement; + +public interface YakshaEnumFieldWoIndent extends PsiElement { + + //WARNING: getName(...) is skipped + //matching getName(YakshaEnumFieldWoIndent, ...) + //methods are not found in YakshaPsiImplUtil + + //WARNING: getNameIdentifier(...) is skipped + //matching getNameIdentifier(YakshaEnumFieldWoIndent, ...) + //methods are not found in YakshaPsiImplUtil + + //WARNING: getPresentation(...) is skipped + //matching getPresentation(YakshaEnumFieldWoIndent, ...) + //methods are not found in YakshaPsiImplUtil + +} diff --git a/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaEnumStatement.java b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaEnumStatement.java new file mode 100644 index 00000000..f0dc2575 --- /dev/null +++ b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaEnumStatement.java @@ -0,0 +1,29 @@ +// This is a generated file. Not intended for manual editing. +package org.intellij.sdk.language.psi; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.psi.PsiElement; + +public interface YakshaEnumStatement extends YakshaNamedElement { + + @NotNull + YakshaEnumBlock getEnumBlock(); + + //WARNING: getName(...) is skipped + //matching getName(YakshaEnumStatement, ...) + //methods are not found in YakshaPsiImplUtil + + //WARNING: setName(...) is skipped + //matching setName(YakshaEnumStatement, ...) + //methods are not found in YakshaPsiImplUtil + + //WARNING: getNameIdentifier(...) is skipped + //matching getNameIdentifier(YakshaEnumStatement, ...) + //methods are not found in YakshaPsiImplUtil + + //WARNING: getPresentation(...) is skipped + //matching getPresentation(YakshaEnumStatement, ...) + //methods are not found in YakshaPsiImplUtil + +} diff --git a/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaOuterStatement.java b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaOuterStatement.java index 08ac7f42..14e2fa78 100644 --- a/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaOuterStatement.java +++ b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaOuterStatement.java @@ -25,6 +25,9 @@ public interface YakshaOuterStatement extends PsiElement { @Nullable YakshaDslOuterBlock getDslOuterBlock(); + @Nullable + YakshaEnumStatement getEnumStatement(); + @Nullable YakshaImportStatement getImportStatement(); diff --git a/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaTypes.java b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaTypes.java index 9e356f3c..23ba0e43 100644 --- a/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaTypes.java +++ b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaTypes.java @@ -50,6 +50,11 @@ public interface YakshaTypes { IElementType ELIF_STATEMENT = new YakshaElementType("ELIF_STATEMENT"); IElementType ELSE_STATEMENT = new YakshaElementType("ELSE_STATEMENT"); IElementType EMPTY_LINE = new YakshaElementType("EMPTY_LINE"); + IElementType ENUM_BITS = new YakshaElementType("ENUM_BITS"); + IElementType ENUM_BLOCK = new YakshaElementType("ENUM_BLOCK"); + IElementType ENUM_FIELD = new YakshaElementType("ENUM_FIELD"); + IElementType ENUM_FIELD_WO_INDENT = new YakshaElementType("ENUM_FIELD_WO_INDENT"); + IElementType ENUM_STATEMENT = new YakshaElementType("ENUM_STATEMENT"); IElementType EXP = new YakshaElementType("EXP"); IElementType EXPR_STATEMENT = new YakshaElementType("EXPR_STATEMENT"); IElementType EXPR_STATEMENT_WO_INDENT = new YakshaElementType("EXPR_STATEMENT_WO_INDENT"); @@ -99,6 +104,7 @@ public interface YakshaTypes { IElementType KW_DIRECTIVE = new YakshaTokenType("KW_DIRECTIVE"); IElementType KW_ELIF = new YakshaTokenType("KW_ELIF"); IElementType KW_ELSE = new YakshaTokenType("KW_ELSE"); + IElementType KW_ENUM = new YakshaTokenType("KW_ENUM"); IElementType KW_FALSE = new YakshaTokenType("KW_FALSE"); IElementType KW_FOR = new YakshaTokenType("KW_FOR"); IElementType KW_IF = new YakshaTokenType("KW_IF"); @@ -286,6 +292,21 @@ else if (type == ELSE_STATEMENT) { else if (type == EMPTY_LINE) { return new YakshaEmptyLineImpl(node); } + else if (type == ENUM_BITS) { + return new YakshaEnumBitsImpl(node); + } + else if (type == ENUM_BLOCK) { + return new YakshaEnumBlockImpl(node); + } + else if (type == ENUM_FIELD) { + return new YakshaEnumFieldImpl(node); + } + else if (type == ENUM_FIELD_WO_INDENT) { + return new YakshaEnumFieldWoIndentImpl(node); + } + else if (type == ENUM_STATEMENT) { + return new YakshaEnumStatementImpl(node); + } else if (type == EXP) { return new YakshaExpImpl(node); } diff --git a/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaVisitor.java b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaVisitor.java index 6d225c81..0a4152ed 100644 --- a/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaVisitor.java +++ b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/YakshaVisitor.java @@ -175,6 +175,26 @@ public void visitEmptyLine(@NotNull YakshaEmptyLine o) { visitPsiElement(o); } + public void visitEnumBits(@NotNull YakshaEnumBits o) { + visitPsiElement(o); + } + + public void visitEnumBlock(@NotNull YakshaEnumBlock o) { + visitPsiElement(o); + } + + public void visitEnumField(@NotNull YakshaEnumField o) { + visitPsiElement(o); + } + + public void visitEnumFieldWoIndent(@NotNull YakshaEnumFieldWoIndent o) { + visitPsiElement(o); + } + + public void visitEnumStatement(@NotNull YakshaEnumStatement o) { + visitNamedElement(o); + } + public void visitExp(@NotNull YakshaExp o) { visitPsiElement(o); } diff --git a/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaEnumBitsImpl.java b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaEnumBitsImpl.java new file mode 100644 index 00000000..24e7829d --- /dev/null +++ b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaEnumBitsImpl.java @@ -0,0 +1,42 @@ +// This is a generated file. Not intended for manual editing. +package org.intellij.sdk.language.psi.impl; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiElementVisitor; +import com.intellij.psi.util.PsiTreeUtil; +import static org.intellij.sdk.language.psi.YakshaTypes.*; +import com.intellij.extapi.psi.ASTWrapperPsiElement; +import org.intellij.sdk.language.psi.*; + +public class YakshaEnumBitsImpl extends ASTWrapperPsiElement implements YakshaEnumBits { + + public YakshaEnumBitsImpl(@NotNull ASTNode node) { + super(node); + } + + public void accept(@NotNull YakshaVisitor visitor) { + visitor.visitEnumBits(this); + } + + @Override + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof YakshaVisitor) accept((YakshaVisitor)visitor); + else super.accept(visitor); + } + + @Override + @Nullable + public YakshaEmptyLine getEmptyLine() { + return findChildByClass(YakshaEmptyLine.class); + } + + @Override + @Nullable + public YakshaEnumField getEnumField() { + return findChildByClass(YakshaEnumField.class); + } + +} diff --git a/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaEnumBlockImpl.java b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaEnumBlockImpl.java new file mode 100644 index 00000000..d7963bba --- /dev/null +++ b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaEnumBlockImpl.java @@ -0,0 +1,42 @@ +// This is a generated file. Not intended for manual editing. +package org.intellij.sdk.language.psi.impl; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiElementVisitor; +import com.intellij.psi.util.PsiTreeUtil; +import static org.intellij.sdk.language.psi.YakshaTypes.*; +import com.intellij.extapi.psi.ASTWrapperPsiElement; +import org.intellij.sdk.language.psi.*; + +public class YakshaEnumBlockImpl extends ASTWrapperPsiElement implements YakshaEnumBlock { + + public YakshaEnumBlockImpl(@NotNull ASTNode node) { + super(node); + } + + public void accept(@NotNull YakshaVisitor visitor) { + visitor.visitEnumBlock(this); + } + + @Override + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof YakshaVisitor) accept((YakshaVisitor)visitor); + else super.accept(visitor); + } + + @Override + @NotNull + public List getEnumBitsList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, YakshaEnumBits.class); + } + + @Override + @Nullable + public YakshaEnumFieldWoIndent getEnumFieldWoIndent() { + return findChildByClass(YakshaEnumFieldWoIndent.class); + } + +} diff --git a/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaEnumFieldImpl.java b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaEnumFieldImpl.java new file mode 100644 index 00000000..a7952d7b --- /dev/null +++ b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaEnumFieldImpl.java @@ -0,0 +1,36 @@ +// This is a generated file. Not intended for manual editing. +package org.intellij.sdk.language.psi.impl; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiElementVisitor; +import com.intellij.psi.util.PsiTreeUtil; +import static org.intellij.sdk.language.psi.YakshaTypes.*; +import com.intellij.extapi.psi.ASTWrapperPsiElement; +import org.intellij.sdk.language.psi.*; + +public class YakshaEnumFieldImpl extends ASTWrapperPsiElement implements YakshaEnumField { + + public YakshaEnumFieldImpl(@NotNull ASTNode node) { + super(node); + } + + public void accept(@NotNull YakshaVisitor visitor) { + visitor.visitEnumField(this); + } + + @Override + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof YakshaVisitor) accept((YakshaVisitor)visitor); + else super.accept(visitor); + } + + @Override + @NotNull + public YakshaEnumFieldWoIndent getEnumFieldWoIndent() { + return findNotNullChildByClass(YakshaEnumFieldWoIndent.class); + } + +} diff --git a/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaEnumFieldWoIndentImpl.java b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaEnumFieldWoIndentImpl.java new file mode 100644 index 00000000..28ba6b1e --- /dev/null +++ b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaEnumFieldWoIndentImpl.java @@ -0,0 +1,30 @@ +// This is a generated file. Not intended for manual editing. +package org.intellij.sdk.language.psi.impl; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiElementVisitor; +import com.intellij.psi.util.PsiTreeUtil; +import static org.intellij.sdk.language.psi.YakshaTypes.*; +import com.intellij.extapi.psi.ASTWrapperPsiElement; +import org.intellij.sdk.language.psi.*; + +public class YakshaEnumFieldWoIndentImpl extends ASTWrapperPsiElement implements YakshaEnumFieldWoIndent { + + public YakshaEnumFieldWoIndentImpl(@NotNull ASTNode node) { + super(node); + } + + public void accept(@NotNull YakshaVisitor visitor) { + visitor.visitEnumFieldWoIndent(this); + } + + @Override + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof YakshaVisitor) accept((YakshaVisitor)visitor); + else super.accept(visitor); + } + +} diff --git a/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaEnumStatementImpl.java b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaEnumStatementImpl.java new file mode 100644 index 00000000..3fe3f7a7 --- /dev/null +++ b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaEnumStatementImpl.java @@ -0,0 +1,42 @@ +// This is a generated file. Not intended for manual editing. +package org.intellij.sdk.language.psi.impl; + +import java.util.List; + +import com.intellij.openapi.util.NlsSafe; +import com.intellij.util.IncorrectOperationException; +import org.jetbrains.annotations.*; +import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiElementVisitor; +import com.intellij.psi.util.PsiTreeUtil; +import static org.intellij.sdk.language.psi.YakshaTypes.*; +import org.intellij.sdk.language.psi.*; + +public class YakshaEnumStatementImpl extends YakshaNamedElementImpl implements YakshaEnumStatement { + + public YakshaEnumStatementImpl(@NotNull ASTNode node) { + super(node); + } + + public void accept(@NotNull YakshaVisitor visitor) { + visitor.visitEnumStatement(this); + } + + @Override + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof YakshaVisitor) accept((YakshaVisitor)visitor); + else super.accept(visitor); + } + + @Override + @NotNull + public YakshaEnumBlock getEnumBlock() { + return findNotNullChildByClass(YakshaEnumBlock.class); + } + + @Override + public PsiElement setName(@NlsSafe @NotNull String name) throws IncorrectOperationException { + return null; + } +} diff --git a/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaOuterStatementImpl.java b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaOuterStatementImpl.java index 52e9a687..c8b9b780 100644 --- a/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaOuterStatementImpl.java +++ b/editor/intellij/src/main/gen/org/intellij/sdk/language/psi/impl/YakshaOuterStatementImpl.java @@ -63,6 +63,12 @@ public YakshaDslOuterBlock getDslOuterBlock() { return findChildByClass(YakshaDslOuterBlock.class); } + @Override + @Nullable + public YakshaEnumStatement getEnumStatement() { + return findChildByClass(YakshaEnumStatement.class); + } + @Override @Nullable public YakshaImportStatement getImportStatement() { diff --git a/editor/intellij/src/main/java/org/intellij/sdk/language/Yaksha.bnf b/editor/intellij/src/main/java/org/intellij/sdk/language/Yaksha.bnf index 3534d1a4..181a85ff 100644 --- a/editor/intellij/src/main/java/org/intellij/sdk/language/Yaksha.bnf +++ b/editor/intellij/src/main/java/org/intellij/sdk/language/Yaksha.bnf @@ -17,13 +17,13 @@ } yakshaFile ::= item_* {pin=1 recoverWhile="top_level_recover" name="import, def, class"} -private top_level_recover ::= !('@' | 'class' | 'struct' | 'def' | 'import' | 'runtimefeature' | 'macros' | 'directive') +private top_level_recover ::= !('@' | 'class' | 'struct' | 'enum' | 'def' | 'import' | 'runtimefeature' | 'macros' | 'directive') private item_ ::= (outer_statement | COMMENT | empty_line) empty_line ::= S? NL -outer_statement ::= directive_statement | runtimefeature_statement | import_statement | const_statement | annotation* class_statement | annotation* def_statement | macro_declaration_statement | dsl_outer_block +outer_statement ::= directive_statement | runtimefeature_statement | import_statement | const_statement | annotation* class_statement | annotation* def_statement | enum_statement | macro_declaration_statement | dsl_outer_block runtimefeature_statement ::= KW_RUNTIMEFEATURE S STRING S? NL @@ -65,6 +65,21 @@ class_field_wo_indent ::= IDENTIFIER S? OPERATOR_COLON S? data_type S? NL { single_line_class_bits ::= pass_statement_wo_indent | class_field_wo_indent class_block ::= single_line_class_bits | NL class_bits+ +enum_statement ::= KW_ENUM S IDENTIFIER S? OPERATOR_COLON S? enum_block { + mixin="org.intellij.sdk.language.psi.impl.YakshaNamedElementImpl" + implements="org.intellij.sdk.language.psi.YakshaNamedElement" + methods=[getName setName getNameIdentifier getPresentation] +} + +enum_bits ::= COMMENT | empty_line | enum_field +enum_field ::= I enum_field_wo_indent { + methods=[getName getNameIdentifier getPresentation] +} +enum_field_wo_indent ::= IDENTIFIER S? NL { + methods=[getName getNameIdentifier getPresentation] +} +enum_block ::= enum_field_wo_indent | NL enum_bits+ + def_statement ::= KW_DEF S IDENTIFIER S? OPERATOR_OPEN_P S? def_params? S? OPERATOR_CLOSE_P S? OPERATOR_ARROW S? data_type S? OPERATOR_COLON S? def_block { mixin="org.intellij.sdk.language.psi.impl.YakshaNamedElementImpl" implements="org.intellij.sdk.language.psi.YakshaNamedElement" diff --git a/editor/intellij/src/main/java/org/intellij/sdk/language/Yaksha.flex b/editor/intellij/src/main/java/org/intellij/sdk/language/Yaksha.flex index 9d918397..1b0b4a58 100644 --- a/editor/intellij/src/main/java/org/intellij/sdk/language/Yaksha.flex +++ b/editor/intellij/src/main/java/org/intellij/sdk/language/Yaksha.flex @@ -1,10 +1,8 @@ package org.intellij.sdk.language; -import com.intellij.lexer.FlexLexer; +import com.intellij.psi.TokenType; import com.intellij.psi.tree.IElementType; -import org.intellij.sdk.language.psi.YakshaTokenType; import org.intellij.sdk.language.psi.YakshaTypes; -import com.intellij.psi.TokenType; %% @@ -83,6 +81,7 @@ TRIPLE_APOS_LITERAL = {THREE_APOS} {APOS_STRING_CHAR}* {THREE_APOS}? "as" { return YakshaTypes.KW_AS; } "break" { return YakshaTypes.KW_BREAK; } "class" { return YakshaTypes.KW_CLASS; } + "enum" { return YakshaTypes.KW_ENUM; } "struct" { return YakshaTypes.KW_STRUCT; } "ccode" { return YakshaTypes.KW_CCODE; } "continue" { return YakshaTypes.KW_CONTINUE; } diff --git a/editor/intellij/src/main/java/org/intellij/sdk/language/YakshaSyntaxHighlighter.java b/editor/intellij/src/main/java/org/intellij/sdk/language/YakshaSyntaxHighlighter.java index c29b6b49..53718d7c 100644 --- a/editor/intellij/src/main/java/org/intellij/sdk/language/YakshaSyntaxHighlighter.java +++ b/editor/intellij/src/main/java/org/intellij/sdk/language/YakshaSyntaxHighlighter.java @@ -117,6 +117,7 @@ public class YakshaSyntaxHighlighter extends SyntaxHighlighterBase { .add(YakshaTypes.KW_NONE) .add(YakshaTypes.KW_MACROS) .add(YakshaTypes.KW_DIRECTIVE) + .add(YakshaTypes.KW_ENUM) .build(); @NotNull