diff --git a/src/main/gen/com/spicelang/intellij/spice/SpiceLexer.java b/src/main/gen/com/spicelang/intellij/spice/SpiceLexer.java index aee5256..961a1a6 100644 --- a/src/main/gen/com/spicelang/intellij/spice/SpiceLexer.java +++ b/src/main/gen/com/spicelang/intellij/spice/SpiceLexer.java @@ -110,21 +110,22 @@ private static int zzUnpackcmap_blocks(String packed, int offset, int [] result) "\1\50\1\51\1\52\1\53\1\0\2\17\1\54\1\55"+ "\1\0\1\56\1\0\1\57\1\60\4\0\1\61\1\62"+ "\1\17\1\63\1\0\1\64\1\65\1\66\1\0\1\67"+ - "\1\32\1\70\5\32\1\71\7\32\1\72\22\32\1\73"+ - "\1\74\4\0\1\75\3\0\4\17\1\76\1\77\11\32"+ + "\1\32\1\70\7\32\1\71\7\32\1\72\23\32\1\73"+ + "\1\74\4\0\1\75\3\0\4\17\1\76\1\77\13\32"+ "\1\100\2\32\1\101\1\32\1\102\3\32\1\103\1\104"+ - "\2\32\1\105\15\32\4\17\1\0\1\56\3\0\1\106"+ - "\3\32\1\107\1\32\1\110\1\111\4\32\1\112\1\113"+ - "\2\32\1\114\3\32\1\115\1\116\12\32\1\117\1\120"+ - "\3\32\1\106\1\121\1\122\2\32\1\123\1\32\1\124"+ - "\2\32\1\125\5\32\1\126\3\32\1\127\6\32\1\130"+ - "\1\32\1\131\2\32\1\132\1\32\1\133\1\134\2\32"+ - "\1\135\1\136\1\137\1\140\1\141\1\142\1\143\1\144"+ - "\1\32\1\145\1\146\1\32\1\147\3\32\1\150\1\32"+ - "\1\151\1\152\1\153"; + "\2\32\1\105\16\32\4\17\1\0\1\56\3\0\1\106"+ + "\3\32\1\107\1\32\1\110\1\111\1\112\5\32\1\113"+ + "\1\114\3\32\1\115\3\32\1\116\1\117\13\32\1\120"+ + "\1\121\3\32\1\106\1\122\1\123\2\32\1\124\1\32"+ + "\1\125\4\32\1\126\5\32\1\127\3\32\1\130\7\32"+ + "\1\131\1\32\1\132\3\32\1\133\2\32\1\134\1\135"+ + "\2\32\1\136\1\137\1\140\1\141\1\142\1\143\1\144"+ + "\1\145\1\146\1\32\1\147\1\150\1\32\1\151\1\32"+ + "\1\152\3\32\1\153\2\32\1\154\1\155\1\32\1\156"+ + "\1\32\1\157"; private static int [] zzUnpackAction() { - int [] result = new int[282]; + int [] result = new int[304]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; @@ -162,32 +163,34 @@ private static int zzUnpackAction(String packed, int offset, int [] result) { "\0\u0e22\0\103\0\103\0\u0e65\0\103\0\u0ea8\0\103\0\103"+ "\0\103\0\u0eeb\0\103\0\u0f2e\0\u0f71\0\u0fb4\0\u0ff7\0\u103a"+ "\0\u107d\0\u10c0\0\u1103\0\u1146\0\u1189\0\u11cc\0\u120f\0\u1252"+ - "\0\u1295\0\u12d8\0\u05c2\0\u131b\0\u135e\0\u13a1\0\u13e4\0\u1427"+ + "\0\u1295\0\u12d8\0\u131b\0\u135e\0\u05c2\0\u13a1\0\u13e4\0\u1427"+ "\0\u146a\0\u14ad\0\u14f0\0\u1533\0\u1576\0\u15b9\0\u15fc\0\u163f"+ - "\0\u1682\0\u16c5\0\u1708\0\u174b\0\u178e\0\103\0\103\0\u17d1"+ - "\0\u1814\0\u1857\0\u189a\0\103\0\u18dd\0\u1920\0\u1963\0\u19a6"+ - "\0\u19e9\0\u1a2c\0\u1a6f\0\103\0\103\0\u1ab2\0\u1af5\0\u1b38"+ - "\0\u1b7b\0\u1bbe\0\u1c01\0\u1c44\0\u1c87\0\u1cca\0\u05c2\0\u1d0d"+ - "\0\u1d50\0\u05c2\0\u1d93\0\u1dd6\0\u1e19\0\u1e5c\0\u1e9f\0\u1ee2"+ - "\0\u05c2\0\u1f25\0\u1f68\0\u05c2\0\u1fab\0\u1fee\0\u2031\0\u2074"+ - "\0\u20b7\0\u20fa\0\u213d\0\u2180\0\u21c3\0\u2206\0\u2249\0\u228c"+ - "\0\u22cf\0\u2312\0\u2355\0\u2398\0\u23db\0\u241e\0\u241e\0\u2461"+ - "\0\u24a4\0\u24e7\0\u24a4\0\u252a\0\u256d\0\u25b0\0\u05c2\0\u25f3"+ - "\0\u05c2\0\u05c2\0\u2636\0\u2679\0\u26bc\0\u26ff\0\u05c2\0\u05c2"+ - "\0\u2742\0\u2785\0\u05c2\0\u27c8\0\u280b\0\u284e\0\u05c2\0\u05c2"+ - "\0\u2891\0\u28d4\0\u2917\0\u295a\0\u299d\0\u29e0\0\u2a23\0\u2a66"+ - "\0\u2aa9\0\u2aec\0\u05c2\0\u05c2\0\u2b2f\0\u2b72\0\u2bb5\0\103"+ - "\0\103\0\u05c2\0\u2bf8\0\u2c3b\0\u05c2\0\u2c7e\0\u05c2\0\u2cc1"+ - "\0\u2d04\0\u05c2\0\u2d47\0\u2d8a\0\u2dcd\0\u2e10\0\u2e53\0\u05c2"+ - "\0\u2e96\0\u2ed9\0\u2f1c\0\u05c2\0\u2f5f\0\u2fa2\0\u2fe5\0\u3028"+ - "\0\u306b\0\u30ae\0\u05c2\0\u30f1\0\u05c2\0\u3134\0\u3177\0\u05c2"+ - "\0\u31ba\0\u05c2\0\u05c2\0\u31fd\0\u3240\0\u05c2\0\u05c2\0\u05c2"+ - "\0\u05c2\0\u05c2\0\u05c2\0\u05c2\0\u05c2\0\u3283\0\u05c2\0\u05c2"+ - "\0\u32c6\0\u05c2\0\u3309\0\u334c\0\u338f\0\u05c2\0\u33d2\0\u05c2"+ - "\0\u05c2\0\u05c2"; + "\0\u1682\0\u16c5\0\u1708\0\u174b\0\u178e\0\u17d1\0\u1814\0\u1857"+ + "\0\103\0\103\0\u189a\0\u18dd\0\u1920\0\u1963\0\103\0\u19a6"+ + "\0\u19e9\0\u1a2c\0\u1a6f\0\u1ab2\0\u1af5\0\u1b38\0\103\0\103"+ + "\0\u1b7b\0\u1bbe\0\u1c01\0\u1c44\0\u1c87\0\u1cca\0\u1d0d\0\u1d50"+ + "\0\u1d93\0\u1dd6\0\u1e19\0\u05c2\0\u1e5c\0\u1e9f\0\u05c2\0\u1ee2"+ + "\0\u1f25\0\u1f68\0\u1fab\0\u1fee\0\u2031\0\u05c2\0\u2074\0\u20b7"+ + "\0\u05c2\0\u20fa\0\u213d\0\u2180\0\u21c3\0\u2206\0\u2249\0\u228c"+ + "\0\u22cf\0\u2312\0\u2355\0\u2398\0\u23db\0\u241e\0\u2461\0\u24a4"+ + "\0\u24e7\0\u252a\0\u256d\0\u25b0\0\u25b0\0\u25f3\0\u2636\0\u2679"+ + "\0\u2636\0\u26bc\0\u26ff\0\u2742\0\u05c2\0\u2785\0\u05c2\0\u05c2"+ + "\0\u05c2\0\u27c8\0\u280b\0\u284e\0\u2891\0\u28d4\0\u05c2\0\u05c2"+ + "\0\u2917\0\u295a\0\u299d\0\u05c2\0\u29e0\0\u2a23\0\u2a66\0\u05c2"+ + "\0\u05c2\0\u2aa9\0\u2aec\0\u2b2f\0\u2b72\0\u2bb5\0\u2bf8\0\u2c3b"+ + "\0\u2c7e\0\u2cc1\0\u2d04\0\u2d47\0\u05c2\0\u05c2\0\u2d8a\0\u2dcd"+ + "\0\u2e10\0\103\0\103\0\u05c2\0\u2e53\0\u2e96\0\u05c2\0\u2ed9"+ + "\0\u05c2\0\u2f1c\0\u2f5f\0\u2fa2\0\u2fe5\0\u05c2\0\u3028\0\u306b"+ + "\0\u30ae\0\u30f1\0\u3134\0\u05c2\0\u3177\0\u31ba\0\u31fd\0\u05c2"+ + "\0\u3240\0\u3283\0\u32c6\0\u3309\0\u334c\0\u338f\0\u33d2\0\u05c2"+ + "\0\u3415\0\u05c2\0\u3458\0\u349b\0\u34de\0\u05c2\0\u3521\0\u3564"+ + "\0\u05c2\0\u05c2\0\u35a7\0\u35ea\0\u05c2\0\u05c2\0\u05c2\0\u05c2"+ + "\0\u05c2\0\u05c2\0\u05c2\0\u05c2\0\u05c2\0\u362d\0\u05c2\0\u05c2"+ + "\0\u3670\0\u05c2\0\u36b3\0\u05c2\0\u36f6\0\u3739\0\u377c\0\u05c2"+ + "\0\u37bf\0\u3802\0\u05c2\0\u05c2\0\u3845\0\u05c2\0\u3888\0\u05c2"; private static int [] zzUnpackRowMap() { - int [] result = new int[282]; + int [] result = new int[304]; int offset = 0; offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); return result; @@ -234,175 +237,194 @@ private static int zzUnpackRowMap(String packed, int offset, int [] result) { "\7\36\4\0\13\36\1\134\5\36\1\135\6\36\26\0"+ "\4\36\6\0\7\36\4\0\16\36\1\136\1\36\1\137"+ "\5\36\1\140\1\36\26\0\4\36\6\0\7\36\4\0"+ - "\10\36\1\141\5\36\1\142\11\36\26\0\4\36\6\0"+ - "\7\36\4\0\16\36\1\143\7\36\1\144\1\36\26\0"+ - "\4\36\6\0\7\36\4\0\13\36\1\145\1\36\1\146"+ - "\7\36\1\147\2\36\26\0\4\36\6\0\7\36\4\0"+ - "\1\36\1\150\14\36\1\151\11\36\26\0\4\36\6\0"+ - "\7\36\4\0\5\36\1\152\22\36\26\0\4\36\6\0"+ - "\7\36\4\0\6\36\1\153\5\36\1\154\1\155\12\36"+ - "\26\0\4\36\6\0\7\36\4\0\5\36\1\156\10\36"+ - "\1\157\11\36\26\0\4\36\6\0\7\36\4\0\1\36"+ - "\1\160\26\36\26\0\4\36\6\0\7\36\4\0\11\36"+ - "\1\161\16\36\26\0\4\36\6\0\7\36\4\0\17\36"+ - "\1\162\10\36\26\0\4\36\6\0\7\36\4\0\1\36"+ - "\1\163\16\36\1\164\2\36\1\165\4\36\26\0\4\36"+ - "\6\0\7\36\4\0\5\36\1\166\22\36\26\0\4\36"+ - "\6\0\7\36\4\0\10\36\1\167\1\170\10\36\1\171"+ - "\5\36\26\0\4\36\6\0\7\36\4\0\20\36\1\172"+ - "\5\36\1\173\1\36\26\0\4\36\6\0\7\36\4\0"+ - "\15\36\1\174\12\36\26\0\4\36\6\0\7\36\4\0"+ - "\10\36\1\175\17\36\35\0\1\176\46\0\1\177\2\0"+ - "\2\66\2\0\77\66\2\75\2\0\77\75\22\0\4\112"+ - "\75\0\1\104\1\0\4\106\7\0\1\200\1\201\2\0"+ - "\1\202\1\203\6\0\1\200\1\0\1\201\3\0\1\202"+ - "\2\0\1\122\2\0\1\203\2\0\1\123\3\0\1\202"+ - "\26\0\1\104\1\0\4\106\34\0\1\122\5\0\1\123"+ - "\32\0\1\204\104\0\4\112\11\0\1\205\14\0\1\205"+ - "\26\0\14\206\1\207\66\206\2\114\2\0\77\114\22\0"+ - "\2\210\101\0\4\211\77\0\4\212\6\0\4\212\10\0"+ - "\6\212\47\0\3\213\140\0\1\122\5\0\1\123\43\0"+ - "\1\214\102\0\1\215\73\0\4\36\6\0\7\36\4\0"+ - "\11\36\1\216\16\36\26\0\4\36\6\0\7\36\4\0"+ - "\21\36\1\217\6\36\26\0\4\36\6\0\7\36\4\0"+ - "\16\36\1\220\11\36\26\0\4\36\6\0\7\36\4\0"+ - "\5\36\1\221\22\36\26\0\4\36\6\0\7\36\4\0"+ - "\22\36\1\222\5\36\26\0\4\36\6\0\7\36\4\0"+ - "\1\36\1\223\26\36\26\0\4\36\6\0\7\36\4\0"+ - "\14\36\1\224\1\225\12\36\26\0\4\36\6\0\7\36"+ - "\4\0\23\36\1\226\4\36\26\0\4\36\6\0\7\36"+ - "\4\0\15\36\1\227\12\36\26\0\4\36\6\0\7\36"+ - "\4\0\21\36\1\230\6\36\26\0\4\36\6\0\7\36"+ - "\4\0\23\36\1\231\4\36\26\0\4\36\6\0\7\36"+ - "\4\0\22\36\1\232\5\36\26\0\4\36\6\0\7\36"+ - "\4\0\13\36\1\233\14\36\26\0\4\36\6\0\7\36"+ - "\4\0\20\36\1\234\7\36\26\0\4\36\6\0\7\36"+ - "\4\0\1\36\1\235\26\36\26\0\4\36\6\0\7\36"+ - "\4\0\17\36\1\236\10\36\26\0\4\36\6\0\7\36"+ - "\4\0\13\36\1\237\6\36\1\240\5\36\26\0\4\36"+ - "\6\0\7\36\4\0\15\36\1\241\12\36\26\0\4\36"+ - "\6\0\7\36\4\0\15\36\1\242\12\36\26\0\4\36"+ - "\6\0\7\36\4\0\11\36\1\243\16\36\26\0\4\36"+ - "\6\0\7\36\4\0\13\36\1\244\14\36\26\0\4\36"+ - "\6\0\7\36\4\0\5\36\1\245\22\36\26\0\4\36"+ - "\6\0\7\36\4\0\15\36\1\246\12\36\26\0\4\36"+ - "\6\0\7\36\4\0\11\36\1\247\16\36\26\0\4\36"+ - "\6\0\7\36\4\0\2\36\1\250\25\36\26\0\4\36"+ - "\6\0\7\36\4\0\22\36\1\251\5\36\26\0\4\36"+ - "\6\0\7\36\4\0\16\36\1\252\11\36\26\0\4\36"+ - "\6\0\7\36\4\0\7\36\1\253\17\36\1\254\26\0"+ - "\4\36\6\0\7\36\4\0\20\36\1\255\7\36\26\0"+ - "\4\36\6\0\7\36\4\0\23\36\1\256\4\36\26\0"+ - "\4\36\6\0\7\36\4\0\17\36\1\257\10\36\26\0"+ - "\4\36\6\0\7\36\4\0\21\36\1\260\6\36\26\0"+ - "\4\36\6\0\7\36\4\0\11\36\1\261\16\36\26\0"+ - "\2\262\101\0\4\263\77\0\4\264\6\0\4\264\10\0"+ - "\6\264\47\0\3\265\73\0\1\266\1\0\1\266\2\0"+ - "\4\267\55\0\14\206\1\270\66\206\14\271\1\272\4\271"+ - "\1\273\61\271\22\0\2\210\36\0\1\122\5\0\1\123"+ - "\1\0\1\124\32\0\4\211\34\0\1\122\5\0\1\123"+ - "\1\0\1\124\32\0\4\212\6\0\4\212\10\0\6\212"+ - "\4\0\1\122\5\0\1\123\1\0\1\124\32\0\3\213"+ - "\35\0\1\122\5\0\1\123\1\0\1\124\32\0\4\36"+ - "\6\0\7\36\4\0\1\36\1\274\5\36\1\275\20\36"+ - "\26\0\4\36\6\0\7\36\4\0\5\36\1\276\22\36"+ - "\26\0\4\36\6\0\7\36\4\0\13\36\1\277\14\36"+ - "\26\0\4\36\6\0\7\36\4\0\1\36\1\300\26\36"+ - "\26\0\4\36\6\0\7\36\4\0\5\36\1\301\22\36"+ - "\26\0\4\36\6\0\7\36\4\0\20\36\1\302\7\36"+ - "\26\0\4\36\6\0\7\36\4\0\17\36\1\303\10\36"+ - "\26\0\4\36\6\0\7\36\4\0\21\36\1\304\1\305"+ - "\5\36\26\0\4\36\6\0\7\36\4\0\2\36\1\306"+ - "\25\36\26\0\4\36\6\0\7\36\4\0\5\36\1\307"+ - "\22\36\26\0\4\36\6\0\7\36\4\0\14\36\1\310"+ - "\13\36\26\0\4\36\6\0\7\36\4\0\21\36\1\311"+ - "\6\36\26\0\4\36\6\0\7\36\4\0\5\36\1\312"+ - "\22\36\26\0\4\36\6\0\7\36\4\0\17\36\1\313"+ - "\10\36\26\0\4\36\6\0\7\36\4\0\16\36\1\314"+ - "\11\36\26\0\4\36\6\0\7\36\4\0\11\36\1\315"+ - "\16\36\26\0\4\36\6\0\7\36\4\0\5\36\1\316"+ - "\22\36\26\0\4\36\6\0\7\36\4\0\7\36\1\317"+ - "\20\36\26\0\4\36\6\0\7\36\4\0\15\36\1\320"+ - "\12\36\26\0\4\36\6\0\7\36\4\0\20\36\1\321"+ - "\7\36\26\0\4\36\6\0\7\36\4\0\11\36\1\322"+ - "\16\36\26\0\4\36\6\0\7\36\4\0\15\36\1\323"+ - "\12\36\26\0\4\36\6\0\7\36\4\0\13\36\1\324"+ - "\14\36\26\0\4\36\6\0\7\36\4\0\23\36\1\325"+ - "\4\36\26\0\4\36\6\0\7\36\4\0\20\36\1\326"+ - "\7\36\26\0\4\36\6\0\7\36\4\0\15\36\1\327"+ - "\12\36\26\0\4\36\6\0\7\36\4\0\5\36\1\330"+ - "\22\36\26\0\4\36\6\0\7\36\4\0\11\36\1\331"+ - "\11\36\1\332\4\36\26\0\4\36\6\0\7\36\4\0"+ - "\5\36\1\333\22\36\26\0\4\36\6\0\7\36\4\0"+ - "\5\36\1\334\22\36\26\0\4\36\6\0\7\36\4\0"+ - "\1\36\1\335\7\36\1\336\16\36\26\0\4\36\6\0"+ - "\7\36\4\0\13\36\1\337\14\36\26\0\2\262\36\0"+ - "\1\122\5\0\1\123\34\0\4\263\34\0\1\122\5\0"+ - "\1\123\34\0\4\264\6\0\4\264\10\0\6\264\4\0"+ - "\1\122\5\0\1\123\34\0\3\265\35\0\1\122\5\0"+ - "\1\123\34\0\4\267\55\0\14\206\1\270\4\206\1\340"+ - "\61\206\14\271\1\272\102\271\1\272\4\271\1\341\61\271"+ - "\22\0\4\36\6\0\7\36\4\0\21\36\1\342\6\36"+ - "\26\0\4\36\6\0\7\36\4\0\15\36\1\343\12\36"+ - "\26\0\4\36\6\0\7\36\4\0\20\36\1\344\7\36"+ - "\26\0\4\36\6\0\7\36\4\0\12\36\1\345\15\36"+ - "\26\0\4\36\6\0\7\36\4\0\16\36\1\346\11\36"+ - "\26\0\4\36\6\0\7\36\4\0\22\36\1\347\5\36"+ - "\26\0\4\36\6\0\7\36\4\0\11\36\1\350\16\36"+ - "\26\0\4\36\6\0\7\36\4\0\13\36\1\351\14\36"+ - "\26\0\4\36\6\0\7\36\4\0\5\36\1\352\22\36"+ - "\26\0\4\36\6\0\7\36\4\0\1\36\1\353\26\36"+ - "\26\0\4\36\6\0\7\36\4\0\20\36\1\354\7\36"+ + "\1\36\1\141\6\36\1\142\5\36\1\143\11\36\26\0"+ + "\4\36\6\0\7\36\4\0\5\36\1\144\10\36\1\145"+ + "\7\36\1\146\1\36\26\0\4\36\6\0\7\36\4\0"+ + "\13\36\1\147\1\36\1\150\7\36\1\151\2\36\26\0"+ + "\4\36\6\0\7\36\4\0\1\36\1\152\14\36\1\153"+ + "\11\36\26\0\4\36\6\0\7\36\4\0\5\36\1\154"+ + "\22\36\26\0\4\36\6\0\7\36\4\0\6\36\1\155"+ + "\5\36\1\156\1\157\12\36\26\0\4\36\6\0\7\36"+ + "\4\0\5\36\1\160\10\36\1\161\11\36\26\0\4\36"+ + "\6\0\7\36\4\0\1\36\1\162\26\36\26\0\4\36"+ + "\6\0\7\36\4\0\11\36\1\163\16\36\26\0\4\36"+ + "\6\0\7\36\4\0\17\36\1\164\10\36\26\0\4\36"+ + "\6\0\7\36\4\0\1\36\1\165\16\36\1\166\2\36"+ + "\1\167\4\36\26\0\4\36\6\0\7\36\4\0\5\36"+ + "\1\170\22\36\26\0\4\36\6\0\7\36\4\0\10\36"+ + "\1\171\1\172\10\36\1\173\1\36\1\174\3\36\26\0"+ + "\4\36\6\0\7\36\4\0\20\36\1\175\5\36\1\176"+ + "\1\36\26\0\4\36\6\0\7\36\4\0\15\36\1\177"+ + "\12\36\26\0\4\36\6\0\7\36\4\0\10\36\1\200"+ + "\17\36\35\0\1\201\46\0\1\202\2\0\2\66\2\0"+ + "\77\66\2\75\2\0\77\75\22\0\4\112\75\0\1\104"+ + "\1\0\4\106\7\0\1\203\1\204\2\0\1\205\1\206"+ + "\6\0\1\203\1\0\1\204\3\0\1\205\2\0\1\122"+ + "\2\0\1\206\2\0\1\123\3\0\1\205\26\0\1\104"+ + "\1\0\4\106\34\0\1\122\5\0\1\123\32\0\1\207"+ + "\104\0\4\112\11\0\1\210\14\0\1\210\26\0\14\211"+ + "\1\212\66\211\2\114\2\0\77\114\22\0\2\213\101\0"+ + "\4\214\77\0\4\215\6\0\4\215\10\0\6\215\47\0"+ + "\3\216\140\0\1\122\5\0\1\123\43\0\1\217\102\0"+ + "\1\220\73\0\4\36\6\0\7\36\4\0\11\36\1\221"+ + "\16\36\26\0\4\36\6\0\7\36\4\0\21\36\1\222"+ + "\6\36\26\0\4\36\6\0\7\36\4\0\16\36\1\223"+ + "\11\36\26\0\4\36\6\0\7\36\4\0\5\36\1\224"+ + "\22\36\26\0\4\36\6\0\7\36\4\0\22\36\1\225"+ + "\5\36\26\0\4\36\6\0\7\36\4\0\21\36\1\226"+ + "\6\36\26\0\4\36\6\0\7\36\4\0\1\36\1\227"+ + "\26\36\26\0\4\36\6\0\7\36\4\0\14\36\1\230"+ + "\1\231\12\36\26\0\4\36\6\0\7\36\4\0\6\36"+ + "\1\232\21\36\26\0\4\36\6\0\7\36\4\0\23\36"+ + "\1\233\4\36\26\0\4\36\6\0\7\36\4\0\15\36"+ + "\1\234\12\36\26\0\4\36\6\0\7\36\4\0\21\36"+ + "\1\235\6\36\26\0\4\36\6\0\7\36\4\0\23\36"+ + "\1\236\4\36\26\0\4\36\6\0\7\36\4\0\22\36"+ + "\1\237\5\36\26\0\4\36\6\0\7\36\4\0\13\36"+ + "\1\240\14\36\26\0\4\36\6\0\7\36\4\0\20\36"+ + "\1\241\7\36\26\0\4\36\6\0\7\36\4\0\1\36"+ + "\1\242\26\36\26\0\4\36\6\0\7\36\4\0\17\36"+ + "\1\243\10\36\26\0\4\36\6\0\7\36\4\0\13\36"+ + "\1\244\6\36\1\245\5\36\26\0\4\36\6\0\7\36"+ + "\4\0\15\36\1\246\12\36\26\0\4\36\6\0\7\36"+ + "\4\0\15\36\1\247\12\36\26\0\4\36\6\0\7\36"+ + "\4\0\11\36\1\250\16\36\26\0\4\36\6\0\7\36"+ + "\4\0\13\36\1\251\14\36\26\0\4\36\6\0\7\36"+ + "\4\0\5\36\1\252\22\36\26\0\4\36\6\0\7\36"+ + "\4\0\15\36\1\253\12\36\26\0\4\36\6\0\7\36"+ + "\4\0\11\36\1\254\16\36\26\0\4\36\6\0\7\36"+ + "\4\0\2\36\1\255\25\36\26\0\4\36\6\0\7\36"+ + "\4\0\22\36\1\256\5\36\26\0\4\36\6\0\7\36"+ + "\4\0\16\36\1\257\11\36\26\0\4\36\6\0\7\36"+ + "\4\0\7\36\1\260\17\36\1\261\26\0\4\36\6\0"+ + "\7\36\4\0\20\36\1\262\7\36\26\0\4\36\6\0"+ + "\7\36\4\0\11\36\1\263\16\36\26\0\4\36\6\0"+ + "\7\36\4\0\23\36\1\264\4\36\26\0\4\36\6\0"+ + "\7\36\4\0\17\36\1\265\10\36\26\0\4\36\6\0"+ + "\7\36\4\0\21\36\1\266\6\36\26\0\4\36\6\0"+ + "\7\36\4\0\11\36\1\267\16\36\26\0\2\270\101\0"+ + "\4\271\77\0\4\272\6\0\4\272\10\0\6\272\47\0"+ + "\3\273\73\0\1\274\1\0\1\274\2\0\4\275\55\0"+ + "\14\211\1\276\66\211\14\277\1\300\4\277\1\301\61\277"+ + "\22\0\2\213\36\0\1\122\5\0\1\123\1\0\1\124"+ + "\32\0\4\214\34\0\1\122\5\0\1\123\1\0\1\124"+ + "\32\0\4\215\6\0\4\215\10\0\6\215\4\0\1\122"+ + "\5\0\1\123\1\0\1\124\32\0\3\216\35\0\1\122"+ + "\5\0\1\123\1\0\1\124\32\0\4\36\6\0\7\36"+ + "\4\0\1\36\1\302\5\36\1\303\20\36\26\0\4\36"+ + "\6\0\7\36\4\0\5\36\1\304\22\36\26\0\4\36"+ + "\6\0\7\36\4\0\13\36\1\305\14\36\26\0\4\36"+ + "\6\0\7\36\4\0\1\36\1\306\26\36\26\0\4\36"+ + "\6\0\7\36\4\0\5\36\1\307\22\36\26\0\4\36"+ + "\6\0\7\36\4\0\5\36\1\310\22\36\26\0\4\36"+ + "\6\0\7\36\4\0\20\36\1\311\7\36\26\0\4\36"+ + "\6\0\7\36\4\0\17\36\1\312\10\36\26\0\4\36"+ + "\6\0\7\36\4\0\21\36\1\313\1\314\5\36\26\0"+ + "\4\36\6\0\7\36\4\0\1\36\1\315\26\36\26\0"+ + "\4\36\6\0\7\36\4\0\2\36\1\316\25\36\26\0"+ + "\4\36\6\0\7\36\4\0\5\36\1\317\22\36\26\0"+ + "\4\36\6\0\7\36\4\0\14\36\1\320\13\36\26\0"+ + "\4\36\6\0\7\36\4\0\13\36\1\321\5\36\1\322"+ + "\6\36\26\0\4\36\6\0\7\36\4\0\5\36\1\323"+ + "\22\36\26\0\4\36\6\0\7\36\4\0\17\36\1\324"+ + "\10\36\26\0\4\36\6\0\7\36\4\0\16\36\1\325"+ + "\11\36\26\0\4\36\6\0\7\36\4\0\11\36\1\326"+ + "\16\36\26\0\4\36\6\0\7\36\4\0\5\36\1\327"+ + "\22\36\26\0\4\36\6\0\7\36\4\0\7\36\1\330"+ + "\20\36\26\0\4\36\6\0\7\36\4\0\15\36\1\331"+ + "\12\36\26\0\4\36\6\0\7\36\4\0\20\36\1\332"+ + "\7\36\26\0\4\36\6\0\7\36\4\0\11\36\1\333"+ + "\16\36\26\0\4\36\6\0\7\36\4\0\15\36\1\334"+ + "\12\36\26\0\4\36\6\0\7\36\4\0\13\36\1\335"+ + "\14\36\26\0\4\36\6\0\7\36\4\0\23\36\1\336"+ + "\4\36\26\0\4\36\6\0\7\36\4\0\20\36\1\337"+ + "\7\36\26\0\4\36\6\0\7\36\4\0\15\36\1\340"+ + "\12\36\26\0\4\36\6\0\7\36\4\0\5\36\1\341"+ + "\22\36\26\0\4\36\6\0\7\36\4\0\11\36\1\342"+ + "\11\36\1\343\4\36\26\0\4\36\6\0\7\36\4\0"+ + "\22\36\1\344\5\36\26\0\4\36\6\0\7\36\4\0"+ + "\5\36\1\345\22\36\26\0\4\36\6\0\7\36\4\0"+ + "\5\36\1\346\22\36\26\0\4\36\6\0\7\36\4\0"+ + "\1\36\1\347\7\36\1\350\16\36\26\0\4\36\6\0"+ + "\7\36\4\0\13\36\1\351\14\36\26\0\2\270\36\0"+ + "\1\122\5\0\1\123\34\0\4\271\34\0\1\122\5\0"+ + "\1\123\34\0\4\272\6\0\4\272\10\0\6\272\4\0"+ + "\1\122\5\0\1\123\34\0\3\273\35\0\1\122\5\0"+ + "\1\123\34\0\4\275\55\0\14\211\1\276\4\211\1\352"+ + "\61\211\14\277\1\300\102\277\1\300\4\277\1\353\61\277"+ + "\22\0\4\36\6\0\7\36\4\0\21\36\1\354\6\36"+ "\26\0\4\36\6\0\7\36\4\0\15\36\1\355\12\36"+ "\26\0\4\36\6\0\7\36\4\0\20\36\1\356\7\36"+ - "\26\0\4\36\6\0\7\36\4\0\1\36\1\357\26\36"+ - "\26\0\4\36\6\0\7\36\4\0\3\36\1\360\24\36"+ + "\26\0\4\36\6\0\7\36\4\0\12\36\1\357\15\36"+ + "\26\0\4\36\6\0\7\36\4\0\16\36\1\360\11\36"+ "\26\0\4\36\6\0\7\36\4\0\22\36\1\361\5\36"+ "\26\0\4\36\6\0\7\36\4\0\11\36\1\362\16\36"+ - "\26\0\4\36\6\0\7\36\4\0\20\36\1\363\7\36"+ - "\26\0\4\36\6\0\7\36\4\0\22\36\1\364\5\36"+ - "\26\0\4\36\6\0\7\36\4\0\5\36\1\365\22\36"+ - "\26\0\4\36\6\0\7\36\4\0\16\36\1\366\11\36"+ - "\26\0\4\36\6\0\7\36\4\0\15\36\1\367\12\36"+ - "\26\0\4\36\6\0\7\36\4\0\3\36\1\370\24\36"+ - "\26\0\4\36\6\0\7\36\4\0\6\36\1\371\21\36"+ - "\26\0\4\36\6\0\7\36\4\0\7\36\1\372\20\36"+ - "\26\0\4\36\6\0\7\36\4\0\5\36\1\373\22\36"+ - "\26\0\4\36\6\0\7\36\4\0\16\36\1\374\11\36"+ + "\26\0\4\36\6\0\7\36\4\0\23\36\1\363\4\36"+ + "\26\0\4\36\6\0\7\36\4\0\13\36\1\364\14\36"+ + "\26\0\4\36\6\0\7\36\4\0\22\36\1\365\5\36"+ + "\26\0\4\36\6\0\7\36\4\0\5\36\1\366\22\36"+ + "\26\0\4\36\6\0\7\36\4\0\1\36\1\367\26\36"+ + "\26\0\4\36\6\0\7\36\4\0\20\36\1\370\7\36"+ + "\26\0\4\36\6\0\7\36\4\0\15\36\1\371\12\36"+ + "\26\0\4\36\6\0\7\36\4\0\20\36\1\372\7\36"+ + "\26\0\4\36\6\0\7\36\4\0\1\36\1\373\26\36"+ + "\26\0\4\36\6\0\7\36\4\0\3\36\1\374\24\36"+ "\26\0\4\36\6\0\7\36\4\0\22\36\1\375\5\36"+ - "\26\0\4\36\6\0\7\36\4\0\21\36\1\376\6\36"+ - "\26\0\4\36\6\0\7\36\4\0\15\36\1\377\12\36"+ - "\26\0\4\36\6\0\7\36\4\0\5\36\1\u0100\22\36"+ - "\26\0\4\36\6\0\7\36\4\0\3\36\1\u0101\24\36"+ - "\26\0\4\36\6\0\7\36\4\0\22\36\1\u0102\5\36"+ - "\26\0\4\36\6\0\7\36\4\0\5\36\1\u0103\22\36"+ - "\26\0\4\36\6\0\7\36\4\0\6\36\1\u0104\21\36"+ - "\26\0\4\36\6\0\7\36\4\0\22\36\1\u0105\5\36"+ + "\26\0\4\36\6\0\7\36\4\0\11\36\1\376\16\36"+ + "\26\0\4\36\6\0\7\36\4\0\20\36\1\377\7\36"+ + "\26\0\4\36\6\0\7\36\4\0\22\36\1\u0100\5\36"+ + "\26\0\4\36\6\0\7\36\4\0\5\36\1\u0101\22\36"+ + "\26\0\4\36\6\0\7\36\4\0\16\36\1\u0102\11\36"+ + "\26\0\4\36\6\0\7\36\4\0\15\36\1\u0103\12\36"+ + "\26\0\4\36\6\0\7\36\4\0\3\36\1\u0104\24\36"+ + "\26\0\4\36\6\0\7\36\4\0\3\36\1\u0105\24\36"+ "\26\0\4\36\6\0\7\36\4\0\6\36\1\u0106\21\36"+ - "\26\0\4\36\6\0\7\36\4\0\3\36\1\u0107\24\36"+ - "\26\0\4\36\6\0\7\36\4\0\15\36\1\u0108\12\36"+ - "\26\0\4\36\6\0\7\36\4\0\4\36\1\u0109\23\36"+ - "\26\0\4\36\6\0\7\36\4\0\6\36\1\u010a\21\36"+ - "\26\0\4\36\6\0\7\36\4\0\7\36\1\u010b\20\36"+ - "\26\0\4\36\6\0\7\36\4\0\22\36\1\u010c\5\36"+ - "\26\0\4\36\6\0\7\36\4\0\5\36\1\u010d\22\36"+ - "\26\0\4\36\6\0\7\36\4\0\15\36\1\u010e\12\36"+ - "\26\0\4\36\6\0\7\36\4\0\6\36\1\u010f\21\36"+ - "\26\0\4\36\6\0\7\36\4\0\5\36\1\u0110\22\36"+ - "\26\0\4\36\6\0\7\36\4\0\23\36\1\u0111\4\36"+ - "\26\0\4\36\6\0\7\36\4\0\10\36\1\u0112\17\36"+ - "\26\0\4\36\6\0\7\36\4\0\1\36\1\u0113\26\36"+ - "\26\0\4\36\6\0\7\36\4\0\16\36\1\u0114\11\36"+ - "\26\0\4\36\6\0\7\36\4\0\5\36\1\u0115\22\36"+ - "\26\0\4\36\6\0\7\36\4\0\5\36\1\u0116\22\36"+ - "\26\0\4\36\6\0\7\36\4\0\3\36\1\u0117\24\36"+ - "\26\0\4\36\6\0\7\36\4\0\20\36\1\u0118\7\36"+ - "\26\0\4\36\6\0\7\36\4\0\4\36\1\u0119\23\36"+ - "\26\0\4\36\6\0\7\36\4\0\5\36\1\u011a\22\36"+ + "\26\0\4\36\6\0\7\36\4\0\7\36\1\u0107\20\36"+ + "\26\0\4\36\6\0\7\36\4\0\5\36\1\u0108\22\36"+ + "\26\0\4\36\6\0\7\36\4\0\16\36\1\u0109\11\36"+ + "\26\0\4\36\6\0\7\36\4\0\22\36\1\u010a\5\36"+ + "\26\0\4\36\6\0\7\36\4\0\21\36\1\u010b\6\36"+ + "\26\0\4\36\6\0\7\36\4\0\15\36\1\u010c\12\36"+ + "\26\0\4\36\6\0\7\36\4\0\13\36\1\u010d\14\36"+ + "\26\0\4\36\6\0\7\36\4\0\5\36\1\u010e\22\36"+ + "\26\0\4\36\6\0\7\36\4\0\10\36\1\u010f\17\36"+ + "\26\0\4\36\6\0\7\36\4\0\3\36\1\u0110\24\36"+ + "\26\0\4\36\6\0\7\36\4\0\22\36\1\u0111\5\36"+ + "\26\0\4\36\6\0\7\36\4\0\5\36\1\u0112\22\36"+ + "\26\0\4\36\6\0\7\36\4\0\6\36\1\u0113\21\36"+ + "\26\0\4\36\6\0\7\36\4\0\22\36\1\u0114\5\36"+ + "\26\0\4\36\6\0\7\36\4\0\6\36\1\u0115\21\36"+ + "\26\0\4\36\6\0\7\36\4\0\3\36\1\u0116\24\36"+ + "\26\0\4\36\6\0\7\36\4\0\15\36\1\u0117\12\36"+ + "\26\0\4\36\6\0\7\36\4\0\4\36\1\u0118\23\36"+ + "\26\0\4\36\6\0\7\36\4\0\6\36\1\u0119\21\36"+ + "\26\0\4\36\6\0\7\36\4\0\7\36\1\u011a\20\36"+ + "\26\0\4\36\6\0\7\36\4\0\22\36\1\u011b\5\36"+ + "\26\0\4\36\6\0\7\36\4\0\10\36\1\u011c\17\36"+ + "\26\0\4\36\6\0\7\36\4\0\5\36\1\u011d\22\36"+ + "\26\0\4\36\6\0\7\36\4\0\15\36\1\u011e\12\36"+ + "\26\0\4\36\6\0\7\36\4\0\6\36\1\u011f\21\36"+ + "\26\0\4\36\6\0\7\36\4\0\5\36\1\u0120\22\36"+ + "\26\0\4\36\6\0\7\36\4\0\23\36\1\u0121\4\36"+ + "\26\0\4\36\6\0\7\36\4\0\22\36\1\u0122\5\36"+ + "\26\0\4\36\6\0\7\36\4\0\20\36\1\u0123\7\36"+ + "\26\0\4\36\6\0\7\36\4\0\10\36\1\u0124\17\36"+ + "\26\0\4\36\6\0\7\36\4\0\1\36\1\u0125\26\36"+ + "\26\0\4\36\6\0\7\36\4\0\16\36\1\u0126\11\36"+ + "\26\0\4\36\6\0\7\36\4\0\5\36\1\u0127\22\36"+ + "\26\0\4\36\6\0\7\36\4\0\5\36\1\u0128\22\36"+ + "\26\0\4\36\6\0\7\36\4\0\16\36\1\u0129\11\36"+ + "\26\0\4\36\6\0\7\36\4\0\3\36\1\u012a\24\36"+ + "\26\0\4\36\6\0\7\36\4\0\20\36\1\u012b\7\36"+ + "\26\0\4\36\6\0\7\36\4\0\4\36\1\u012c\23\36"+ + "\26\0\4\36\6\0\7\36\4\0\23\36\1\u012d\4\36"+ + "\26\0\4\36\6\0\7\36\4\0\5\36\1\u012e\22\36"+ + "\26\0\4\36\6\0\7\36\4\0\7\36\1\u012f\20\36"+ + "\26\0\4\36\6\0\7\36\4\0\10\36\1\u0130\17\36"+ "\4\0"; private static int [] zzUnpacktrans() { - int [] result = new int[13333]; + int [] result = new int[14539]; int offset = 0; offset = zzUnpacktrans(ZZ_TRANS_PACKED_0, offset, result); return result; @@ -445,11 +467,11 @@ private static int zzUnpacktrans(String packed, int offset, int [] result) { "\1\0\1\11\1\0\4\11\1\0\1\11\1\0\4\11"+ "\1\0\2\1\2\11\1\0\1\1\1\0\1\1\1\11"+ "\4\0\2\11\1\1\1\11\1\0\3\11\1\0\1\11"+ - "\42\1\2\11\4\0\1\11\3\0\4\1\2\11\50\1"+ - "\1\0\1\1\3\0\45\1\2\11\71\1"; + "\45\1\2\11\4\0\1\11\3\0\4\1\2\11\53\1"+ + "\1\0\1\1\3\0\51\1\2\11\105\1"; private static int [] zzUnpackAttribute() { - int [] result = new int[282]; + int [] result = new int[304]; int offset = 0; offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); return result; @@ -775,537 +797,557 @@ else if (zzAtEOF) { { return TokenType.BAD_CHARACTER; } // fall through - case 108: break; + case 112: break; case 2: { return TokenType.WHITE_SPACE; } // fall through - case 109: break; + case 113: break; case 3: { return SpiceTypes.NOT; } // fall through - case 110: break; + case 114: break; case 4: { return SpiceTypes.TOPLEVEL_ATTR_PREAMBLE; } // fall through - case 111: break; + case 115: break; case 5: { return SpiceTypes.REM; } // fall through - case 112: break; + case 116: break; case 6: { return SpiceTypes.BITWISE_AND; } // fall through - case 113: break; + case 117: break; case 7: { return SpiceTypes.LPAREN; } // fall through - case 114: break; + case 118: break; case 8: { return SpiceTypes.RPAREN; } // fall through - case 115: break; + case 119: break; case 9: { return SpiceTypes.MUL; } // fall through - case 116: break; + case 120: break; case 10: { return SpiceTypes.PLUS; } // fall through - case 117: break; + case 121: break; case 11: { return SpiceTypes.COMMA; } // fall through - case 118: break; + case 122: break; case 12: { return SpiceTypes.MINUS; } // fall through - case 119: break; + case 123: break; case 13: { return SpiceTypes.DOT; } // fall through - case 120: break; + case 124: break; case 14: { return SpiceTypes.DIV; } // fall through - case 121: break; + case 125: break; case 15: { return SpiceTypes.INT_LIT; } // fall through - case 122: break; + case 126: break; case 16: { return SpiceTypes.COLON; } // fall through - case 123: break; + case 127: break; case 17: { return SpiceTypes.SEMICOLON; } // fall through - case 124: break; + case 128: break; case 18: { return SpiceTypes.LESS; } // fall through - case 125: break; + case 129: break; case 19: { return SpiceTypes.ASSIGN; } // fall through - case 126: break; + case 130: break; case 20: { return SpiceTypes.GREATER; } // fall through - case 127: break; + case 131: break; case 21: { return SpiceTypes.QUESTION_MARK; } // fall through - case 128: break; + case 132: break; case 22: { return SpiceTypes.TYPE_IDENTIFIER; } // fall through - case 129: break; + case 133: break; case 23: { return SpiceTypes.LBRACKET; } // fall through - case 130: break; + case 134: break; case 24: { return SpiceTypes.RBRACKET; } // fall through - case 131: break; + case 135: break; case 25: { return SpiceTypes.BITWISE_XOR; } // fall through - case 132: break; + case 136: break; case 26: { return SpiceTypes.IDENTIFIER; } // fall through - case 133: break; + case 137: break; case 27: { return SpiceTypes.F; } // fall through - case 134: break; + case 138: break; case 28: { return SpiceTypes.P; } // fall through - case 135: break; + case 139: break; case 29: { return SpiceTypes.LBRACE; } // fall through - case 136: break; + case 140: break; case 30: { return SpiceTypes.BITWISE_OR; } // fall through - case 137: break; + case 141: break; case 31: { return SpiceTypes.RBRACE; } // fall through - case 138: break; + case 142: break; case 32: { return SpiceTypes.BITWISE_NOT; } // fall through - case 139: break; + case 143: break; case 33: { return SpiceTypes.NOT_EQUAL; } // fall through - case 140: break; + case 144: break; case 34: { return SpiceTypes.STRING_LIT; } // fall through - case 141: break; + case 145: break; case 35: { return SpiceTypes.MOD_ATTR_PREAMBLE; } // fall through - case 142: break; + case 146: break; case 36: { return SpiceTypes.REM_EQUAL; } // fall through - case 143: break; + case 147: break; case 37: { return SpiceTypes.LOGICAL_AND; } // fall through - case 144: break; + case 148: break; case 38: { return SpiceTypes.AND_EQUAL; } // fall through - case 145: break; + case 149: break; case 39: { return SpiceTypes.CHAR_LIT; } // fall through - case 146: break; + case 150: break; case 40: { return SpiceTypes.MUL_EQUAL; } // fall through - case 147: break; + case 151: break; case 41: { return SpiceTypes.PLUS_PLUS; } // fall through - case 148: break; + case 152: break; case 42: { return SpiceTypes.PLUS_EQUAL; } // fall through - case 149: break; + case 153: break; case 43: { return SpiceTypes.MINUS_MINUS; } // fall through - case 150: break; + case 154: break; case 44: { return SpiceTypes.MINUS_EQUAL; } // fall through - case 151: break; + case 155: break; case 45: { return SpiceTypes.ARROW; } // fall through - case 152: break; + case 156: break; case 46: { return SpiceTypes.DOUBLE_LIT; } // fall through - case 153: break; + case 157: break; case 47: { return SpiceTypes.LINE_COMMENT; } // fall through - case 154: break; + case 158: break; case 48: { return SpiceTypes.DIV_EQUAL; } // fall through - case 155: break; + case 159: break; case 49: { return SpiceTypes.LONG_LIT; } // fall through - case 156: break; + case 160: break; case 50: { return SpiceTypes.SHORT_LIT; } // fall through - case 157: break; + case 161: break; case 51: { return SpiceTypes.SCOPE_ACCESS; } // fall through - case 158: break; + case 162: break; case 52: { return SpiceTypes.LESS_EQUAL; } // fall through - case 159: break; + case 163: break; case 53: { return SpiceTypes.EQUAL; } // fall through - case 160: break; + case 164: break; case 54: { return SpiceTypes.GREATER_EQUAL; } // fall through - case 161: break; + case 165: break; case 55: { return SpiceTypes.XOR_EQUAL; } // fall through - case 162: break; + case 166: break; case 56: { return SpiceTypes.AS; } // fall through - case 163: break; + case 167: break; case 57: { return SpiceTypes.DO; } // fall through - case 164: break; + case 168: break; case 58: { return SpiceTypes.IF; } // fall through - case 165: break; + case 169: break; case 59: { return SpiceTypes.OR_EQUAL; } // fall through - case 166: break; + case 170: break; case 60: { return SpiceTypes.LOGICAL_OR; } // fall through - case 167: break; + case 171: break; case 61: { return SpiceTypes.ELLIPSIS; } // fall through - case 168: break; + case 172: break; case 62: { return SpiceTypes.SHL_EQUAL; } // fall through - case 169: break; + case 173: break; case 63: { return SpiceTypes.SHR_EQUAL; } // fall through - case 170: break; + case 174: break; case 64: { return SpiceTypes.TYPE_DYN; } // fall through - case 171: break; + case 175: break; case 65: { return SpiceTypes.EXT; } // fall through - case 172: break; + case 176: break; case 66: { return SpiceTypes.FOR; } // fall through - case 173: break; + case 177: break; case 67: { return SpiceTypes.TYPE_INT; } // fall through - case 174: break; + case 178: break; case 68: { return SpiceTypes.LEN; } // fall through - case 175: break; + case 179: break; case 69: { return SpiceTypes.NIL; } // fall through - case 176: break; + case 180: break; case 70: { return SpiceTypes.BLOCK_COMMENT; } // fall through - case 177: break; + case 181: break; case 71: { return SpiceTypes.TYPE_BOOL; } // fall through - case 178: break; + case 182: break; case 72: { return SpiceTypes.TYPE_BYTE; } // fall through - case 179: break; + case 183: break; case 73: - { return SpiceTypes.TYPE_CHAR; + { return SpiceTypes.CASE; } // fall through - case 180: break; + case 184: break; case 74: - { return SpiceTypes.ELSE; + { return SpiceTypes.TYPE_CHAR; } // fall through - case 181: break; + case 185: break; case 75: - { return SpiceTypes.ENUM; + { return SpiceTypes.ELSE; } // fall through - case 182: break; + case 186: break; case 76: - { return SpiceTypes.HEAP; + { return SpiceTypes.ENUM; } // fall through - case 183: break; + case 187: break; case 77: - { return SpiceTypes.TYPE_LONG; + { return SpiceTypes.HEAP; } // fall through - case 184: break; + case 188: break; case 78: - { return SpiceTypes.MAIN; + { return SpiceTypes.TYPE_LONG; } // fall through - case 185: break; + case 189: break; case 79: - { return SpiceTypes.TRUE; + { return SpiceTypes.MAIN; } // fall through - case 186: break; + case 190: break; case 80: - { return SpiceTypes.TYPE; + { return SpiceTypes.TRUE; } // fall through - case 187: break; + case 191: break; case 81: - { return SpiceTypes.DOC_COMMENT; + { return SpiceTypes.TYPE; } // fall through - case 188: break; + case 192: break; case 82: - { return SpiceTypes.ALIAS; + { return SpiceTypes.DOC_COMMENT; } // fall through - case 189: break; + case 193: break; case 83: - { return SpiceTypes.BREAK; + { return SpiceTypes.ALIAS; } // fall through - case 190: break; + case 194: break; case 84: - { return SpiceTypes.CONST; + { return SpiceTypes.BREAK; } // fall through - case 191: break; + case 195: break; case 85: - { return SpiceTypes.FALSE; + { return SpiceTypes.CONST; } // fall through - case 192: break; + case 196: break; case 86: - { return SpiceTypes.PANIC; + { return SpiceTypes.FALSE; } // fall through - case 193: break; + case 197: break; case 87: - { return SpiceTypes.TYPE_SHORT; + { return SpiceTypes.PANIC; } // fall through - case 194: break; + case 198: break; case 88: - { return SpiceTypes.WHILE; + { return SpiceTypes.TYPE_SHORT; } // fall through - case 195: break; + case 199: break; case 89: - { return SpiceTypes.ASSERT; + { return SpiceTypes.WHILE; } // fall through - case 196: break; + case 200: break; case 90: - { return SpiceTypes.TYPE_DOUBLE; + { return SpiceTypes.ASSERT; } // fall through - case 197: break; + case 201: break; case 91: - { return SpiceTypes.IMPORT; + { return SpiceTypes.TYPE_DOUBLE; } // fall through - case 198: break; + case 202: break; case 92: - { return SpiceTypes.INLINE; + { return SpiceTypes.IMPORT; } // fall through - case 199: break; + case 203: break; case 93: - { return SpiceTypes.PRINTF; + { return SpiceTypes.INLINE; } // fall through - case 200: break; + case 204: break; case 94: - { return SpiceTypes.PUBLIC; + { return SpiceTypes.PRINTF; } // fall through - case 201: break; + case 205: break; case 95: - { return SpiceTypes.RETURN; + { return SpiceTypes.PUBLIC; } // fall through - case 202: break; + case 206: break; case 96: - { return SpiceTypes.SIGNED; + { return SpiceTypes.RETURN; } // fall through - case 203: break; + case 207: break; case 97: - { return SpiceTypes.SIZEOF; + { return SpiceTypes.SIGNED; } // fall through - case 204: break; + case 208: break; case 98: - { return SpiceTypes.TYPE_STRING; + { return SpiceTypes.SIZEOF; } // fall through - case 205: break; + case 209: break; case 99: - { return SpiceTypes.STRUCT; + { return SpiceTypes.TYPE_STRING; } // fall through - case 206: break; + case 210: break; case 100: - { return SpiceTypes.UNSAFE; + { return SpiceTypes.STRUCT; } // fall through - case 207: break; + case 211: break; case 101: - { return SpiceTypes.ALIGNOF; + { return SpiceTypes.SWITCH; } // fall through - case 208: break; + case 212: break; case 102: - { return SpiceTypes.COMPOSE; + { return SpiceTypes.UNSAFE; } // fall through - case 209: break; + case 213: break; case 103: - { return SpiceTypes.FOREACH; + { return SpiceTypes.ALIGNOF; } // fall through - case 210: break; + case 214: break; case 104: - { return SpiceTypes.CONTINUE; + { return SpiceTypes.COMPOSE; } // fall through - case 211: break; + case 215: break; case 105: - { return SpiceTypes.OPERATOR; + { return SpiceTypes.DEFAULT; } // fall through - case 212: break; + case 216: break; case 106: - { return SpiceTypes.UNSIGNED; + { return SpiceTypes.FOREACH; } // fall through - case 213: break; + case 217: break; case 107: + { return SpiceTypes.CONTINUE; + } + // fall through + case 218: break; + case 108: + { return SpiceTypes.OPERATOR; + } + // fall through + case 219: break; + case 109: + { return SpiceTypes.UNSIGNED; + } + // fall through + case 220: break; + case 110: { return SpiceTypes.INTERFACE; } // fall through - case 214: break; + case 221: break; + case 111: + { return SpiceTypes.FALLTHROUGH; + } + // fall through + case 222: break; default: zzScanError(ZZ_NO_MATCH); } diff --git a/src/main/gen/com/spicelang/intellij/spice/SpiceParser.java b/src/main/gen/com/spicelang/intellij/spice/SpiceParser.java index bdf444c..49bf6b6 100644 --- a/src/main/gen/com/spicelang/intellij/spice/SpiceParser.java +++ b/src/main/gen/com/spicelang/intellij/spice/SpiceParser.java @@ -580,6 +580,21 @@ public static boolean builtinCall(PsiBuilder b, int l) { return r; } + /* ********************************************************** */ + // CASE constantLst COLON stmtLst + public static boolean caseBranch(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "caseBranch")) return false; + if (!nextTokenIs(b, CASE)) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, CASE); + r = r && constantLst(b, l + 1); + r = r && consumeToken(b, COLON); + r = r && stmtLst(b, l + 1); + exit_section_(b, m, CASE_BRANCH, r); + return r; + } + /* ********************************************************** */ // LPAREN dataType RPAREN prefixUnaryExpr | prefixUnaryExpr public static boolean castExpr(PsiBuilder b, int l) { @@ -623,6 +638,40 @@ public static boolean constant(PsiBuilder b, int l) { return r; } + /* ********************************************************** */ + // constant (COMMA constant)* + public static boolean constantLst(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "constantLst")) return false; + boolean r; + Marker m = enter_section_(b, l, _NONE_, CONSTANT_LST, ""); + r = constant(b, l + 1); + r = r && constantLst_1(b, l + 1); + exit_section_(b, l, m, r, false, null); + return r; + } + + // (COMMA constant)* + private static boolean constantLst_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "constantLst_1")) return false; + while (true) { + int c = current_position_(b); + if (!constantLst_1_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "constantLst_1", c)) break; + } + return true; + } + + // COMMA constant + private static boolean constantLst_1_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "constantLst_1_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, COMMA); + r = r && constant(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + /* ********************************************************** */ // CONTINUE INT_LIT? public static boolean continueStmt(PsiBuilder b, int l) { @@ -799,6 +848,19 @@ private static boolean declStmt_2_0(PsiBuilder b, int l) { return r; } + /* ********************************************************** */ + // DEFAULT COLON stmtLst + public static boolean defaultBranch(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "defaultBranch")) return false; + if (!nextTokenIs(b, DEFAULT)) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeTokens(b, 0, DEFAULT, COLON); + r = r && stmtLst(b, l + 1); + exit_section_(b, m, DEFAULT_BRANCH, r); + return r; + } + /* ********************************************************** */ // DO LBRACE stmtLst RBRACE WHILE assignExpr SEMICOLON public static boolean doWhileLoop(PsiBuilder b, int l) { @@ -988,6 +1050,17 @@ private static boolean equalityExpr_1_0_0(PsiBuilder b, int l) { return r; } + /* ********************************************************** */ + // assignExpr + public static boolean exprStmt(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "exprStmt")) return false; + boolean r; + Marker m = enter_section_(b, l, _NONE_, EXPR_STMT, ""); + r = assignExpr(b, l + 1); + exit_section_(b, l, m, r, false, null); + return r; + } + /* ********************************************************** */ // topLevelDefAttr? EXT (F LESS dataType GREATER | P) (IDENTIFIER | TYPE_IDENTIFIER) LPAREN (typeLst ELLIPSIS?)? RPAREN SEMICOLON public static boolean extDecl(PsiBuilder b, int l) { @@ -1070,6 +1143,18 @@ private static boolean extDecl_5_0_1(PsiBuilder b, int l) { return true; } + /* ********************************************************** */ + // FALLTHROUGH + public static boolean fallthroughStmt(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "fallthroughStmt")) return false; + if (!nextTokenIs(b, FALLTHROUGH)) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, FALLTHROUGH); + exit_section_(b, m, FALLTHROUGH_STMT, r); + return r; + } + /* ********************************************************** */ // dataType IDENTIFIER (ASSIGN assignExpr)? public static boolean field(PsiBuilder b, int l) { @@ -1563,28 +1648,28 @@ private static boolean ifStmt_5(PsiBuilder b, int l) { /* ********************************************************** */ // IMPORT STRING_LIT (AS IDENTIFIER)? SEMICOLON - public static boolean importStmt(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "importStmt")) return false; + public static boolean importDef(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "importDef")) return false; if (!nextTokenIs(b, IMPORT)) return false; boolean r; Marker m = enter_section_(b); r = consumeTokens(b, 0, IMPORT, STRING_LIT); - r = r && importStmt_2(b, l + 1); + r = r && importDef_2(b, l + 1); r = r && consumeToken(b, SEMICOLON); - exit_section_(b, m, IMPORT_STMT, r); + exit_section_(b, m, IMPORT_DEF, r); return r; } // (AS IDENTIFIER)? - private static boolean importStmt_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "importStmt_2")) return false; - importStmt_2_0(b, l + 1); + private static boolean importDef_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "importDef_2")) return false; + importDef_2_0(b, l + 1); return true; } // AS IDENTIFIER - private static boolean importStmt_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "importStmt_2_0")) return false; + private static boolean importDef_2_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "importDef_2_0")) return false; boolean r; Marker m = enter_section_(b); r = consumeTokens(b, 0, AS, IDENTIFIER); @@ -2431,7 +2516,7 @@ public static boolean specifierLst(PsiBuilder b, int l) { } /* ********************************************************** */ - // (mainFunctionDef | functionDef | procedureDef | structDef | interfaceDef | enumDef | genericTypeDef | aliasDef | globalVarDef | importStmt | extDecl | modAttr | docCom | lineCom | blockCom)* + // (mainFunctionDef | functionDef | procedureDef | structDef | interfaceDef | enumDef | genericTypeDef | aliasDef | globalVarDef | importDef | extDecl | modAttr | docCom | lineCom | blockCom)* static boolean spiceFile(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "spiceFile")) return false; while (true) { @@ -2442,7 +2527,7 @@ static boolean spiceFile(PsiBuilder b, int l) { return true; } - // mainFunctionDef | functionDef | procedureDef | structDef | interfaceDef | enumDef | genericTypeDef | aliasDef | globalVarDef | importStmt | extDecl | modAttr | docCom | lineCom | blockCom + // mainFunctionDef | functionDef | procedureDef | structDef | interfaceDef | enumDef | genericTypeDef | aliasDef | globalVarDef | importDef | extDecl | modAttr | docCom | lineCom | blockCom private static boolean spiceFile_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "spiceFile_0")) return false; boolean r; @@ -2455,7 +2540,7 @@ private static boolean spiceFile_0(PsiBuilder b, int l) { if (!r) r = genericTypeDef(b, l + 1); if (!r) r = aliasDef(b, l + 1); if (!r) r = globalVarDef(b, l + 1); - if (!r) r = importStmt(b, l + 1); + if (!r) r = importDef(b, l + 1); if (!r) r = extDecl(b, l + 1); if (!r) r = modAttr(b, l + 1); if (!r) r = docCom(b, l + 1); @@ -2465,7 +2550,7 @@ private static boolean spiceFile_0(PsiBuilder b, int l) { } /* ********************************************************** */ - // (declStmt | assignExpr | returnStmt | breakStmt | continueStmt) SEMICOLON + // (declStmt | returnStmt | breakStmt | continueStmt | fallthroughStmt | exprStmt) SEMICOLON public static boolean stmt(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "stmt")) return false; boolean r; @@ -2476,20 +2561,21 @@ public static boolean stmt(PsiBuilder b, int l) { return r; } - // declStmt | assignExpr | returnStmt | breakStmt | continueStmt + // declStmt | returnStmt | breakStmt | continueStmt | fallthroughStmt | exprStmt private static boolean stmt_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "stmt_0")) return false; boolean r; r = declStmt(b, l + 1); - if (!r) r = assignExpr(b, l + 1); if (!r) r = returnStmt(b, l + 1); if (!r) r = breakStmt(b, l + 1); if (!r) r = continueStmt(b, l + 1); + if (!r) r = fallthroughStmt(b, l + 1); + if (!r) r = exprStmt(b, l + 1); return r; } /* ********************************************************** */ - // (stmt | forLoop | foreachLoop | whileLoop | doWhileLoop | ifStmt | assertStmt | unsafeBlock | anonymousBlockStmt)* + // (stmt | forLoop | foreachLoop | whileLoop | doWhileLoop | ifStmt | switchStmt | assertStmt | unsafeBlock | anonymousBlockStmt)* public static boolean stmtLst(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "stmtLst")) return false; Marker m = enter_section_(b, l, _NONE_, STMT_LST, ""); @@ -2502,7 +2588,7 @@ public static boolean stmtLst(PsiBuilder b, int l) { return true; } - // stmt | forLoop | foreachLoop | whileLoop | doWhileLoop | ifStmt | assertStmt | unsafeBlock | anonymousBlockStmt + // stmt | forLoop | foreachLoop | whileLoop | doWhileLoop | ifStmt | switchStmt | assertStmt | unsafeBlock | anonymousBlockStmt private static boolean stmtLst_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "stmtLst_0")) return false; boolean r; @@ -2512,6 +2598,7 @@ private static boolean stmtLst_0(PsiBuilder b, int l) { if (!r) r = whileLoop(b, l + 1); if (!r) r = doWhileLoop(b, l + 1); if (!r) r = ifStmt(b, l + 1); + if (!r) r = switchStmt(b, l + 1); if (!r) r = assertStmt(b, l + 1); if (!r) r = unsafeBlock(b, l + 1); if (!r) r = anonymousBlockStmt(b, l + 1); @@ -2663,6 +2750,41 @@ private static boolean structInstantiation_4(PsiBuilder b, int l) { return true; } + /* ********************************************************** */ + // SWITCH assignExpr LBRACE caseBranch* defaultBranch? RBRACE + public static boolean switchStmt(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "switchStmt")) return false; + if (!nextTokenIs(b, SWITCH)) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, SWITCH); + r = r && assignExpr(b, l + 1); + r = r && consumeToken(b, LBRACE); + r = r && switchStmt_3(b, l + 1); + r = r && switchStmt_4(b, l + 1); + r = r && consumeToken(b, RBRACE); + exit_section_(b, m, SWITCH_STMT, r); + return r; + } + + // caseBranch* + private static boolean switchStmt_3(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "switchStmt_3")) return false; + while (true) { + int c = current_position_(b); + if (!caseBranch(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "switchStmt_3", c)) break; + } + return true; + } + + // defaultBranch? + private static boolean switchStmt_4(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "switchStmt_4")) return false; + defaultBranch(b, l + 1); + return true; + } + /* ********************************************************** */ // logicalOrExpr (QUESTION_MARK logicalOrExpr? COLON logicalOrExpr)? public static boolean ternaryExpr(PsiBuilder b, int l) { diff --git a/src/main/gen/com/spicelang/intellij/spice/psi/SpiceCaseBranch.java b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceCaseBranch.java new file mode 100644 index 0000000..fa827a6 --- /dev/null +++ b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceCaseBranch.java @@ -0,0 +1,16 @@ +// This is a generated file. Not intended for manual editing. +package com.spicelang.intellij.spice.psi; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.psi.PsiElement; + +public interface SpiceCaseBranch extends PsiElement { + + @NotNull + SpiceConstantLst getConstantLst(); + + @NotNull + SpiceStmtLst getStmtLst(); + +} diff --git a/src/main/gen/com/spicelang/intellij/spice/psi/SpiceConstantLst.java b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceConstantLst.java new file mode 100644 index 0000000..762accf --- /dev/null +++ b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceConstantLst.java @@ -0,0 +1,13 @@ +// This is a generated file. Not intended for manual editing. +package com.spicelang.intellij.spice.psi; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.psi.PsiElement; + +public interface SpiceConstantLst extends PsiElement { + + @NotNull + List getConstantList(); + +} diff --git a/src/main/gen/com/spicelang/intellij/spice/psi/SpiceDefaultBranch.java b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceDefaultBranch.java new file mode 100644 index 0000000..19799da --- /dev/null +++ b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceDefaultBranch.java @@ -0,0 +1,13 @@ +// This is a generated file. Not intended for manual editing. +package com.spicelang.intellij.spice.psi; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.psi.PsiElement; + +public interface SpiceDefaultBranch extends PsiElement { + + @NotNull + SpiceStmtLst getStmtLst(); + +} diff --git a/src/main/gen/com/spicelang/intellij/spice/psi/SpiceExprStmt.java b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceExprStmt.java new file mode 100644 index 0000000..8869d26 --- /dev/null +++ b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceExprStmt.java @@ -0,0 +1,13 @@ +// This is a generated file. Not intended for manual editing. +package com.spicelang.intellij.spice.psi; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.psi.PsiElement; + +public interface SpiceExprStmt extends PsiElement { + + @NotNull + SpiceAssignExpr getAssignExpr(); + +} diff --git a/src/main/gen/com/spicelang/intellij/spice/psi/SpiceFallthroughStmt.java b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceFallthroughStmt.java new file mode 100644 index 0000000..8146921 --- /dev/null +++ b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceFallthroughStmt.java @@ -0,0 +1,10 @@ +// This is a generated file. Not intended for manual editing. +package com.spicelang.intellij.spice.psi; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.psi.PsiElement; + +public interface SpiceFallthroughStmt extends PsiElement { + +} diff --git a/src/main/gen/com/spicelang/intellij/spice/psi/SpiceImportStmt.java b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceImportDef.java similarity index 79% rename from src/main/gen/com/spicelang/intellij/spice/psi/SpiceImportStmt.java rename to src/main/gen/com/spicelang/intellij/spice/psi/SpiceImportDef.java index 05376f9..0623c63 100644 --- a/src/main/gen/com/spicelang/intellij/spice/psi/SpiceImportStmt.java +++ b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceImportDef.java @@ -5,6 +5,6 @@ import org.jetbrains.annotations.*; import com.intellij.psi.PsiElement; -public interface SpiceImportStmt extends PsiElement { +public interface SpiceImportDef extends PsiElement { } diff --git a/src/main/gen/com/spicelang/intellij/spice/psi/SpiceStmt.java b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceStmt.java index 402f79a..ec3e433 100644 --- a/src/main/gen/com/spicelang/intellij/spice/psi/SpiceStmt.java +++ b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceStmt.java @@ -7,9 +7,6 @@ public interface SpiceStmt extends PsiElement { - @Nullable - SpiceAssignExpr getAssignExpr(); - @Nullable SpiceBreakStmt getBreakStmt(); @@ -19,6 +16,12 @@ public interface SpiceStmt extends PsiElement { @Nullable SpiceDeclStmt getDeclStmt(); + @Nullable + SpiceExprStmt getExprStmt(); + + @Nullable + SpiceFallthroughStmt getFallthroughStmt(); + @Nullable SpiceReturnStmt getReturnStmt(); diff --git a/src/main/gen/com/spicelang/intellij/spice/psi/SpiceStmtLst.java b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceStmtLst.java index de14715..0e809ca 100644 --- a/src/main/gen/com/spicelang/intellij/spice/psi/SpiceStmtLst.java +++ b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceStmtLst.java @@ -28,6 +28,9 @@ public interface SpiceStmtLst extends PsiElement { @NotNull List getStmtList(); + @NotNull + List getSwitchStmtList(); + @NotNull List getUnsafeBlockList(); diff --git a/src/main/gen/com/spicelang/intellij/spice/psi/SpiceSwitchStmt.java b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceSwitchStmt.java new file mode 100644 index 0000000..95114c3 --- /dev/null +++ b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceSwitchStmt.java @@ -0,0 +1,19 @@ +// This is a generated file. Not intended for manual editing. +package com.spicelang.intellij.spice.psi; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.psi.PsiElement; + +public interface SpiceSwitchStmt extends PsiElement { + + @NotNull + SpiceAssignExpr getAssignExpr(); + + @NotNull + List getCaseBranchList(); + + @Nullable + SpiceDefaultBranch getDefaultBranch(); + +} diff --git a/src/main/gen/com/spicelang/intellij/spice/psi/SpiceTypes.java b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceTypes.java index 2ba87db..d10e596 100644 --- a/src/main/gen/com/spicelang/intellij/spice/psi/SpiceTypes.java +++ b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceTypes.java @@ -27,12 +27,15 @@ public interface SpiceTypes { IElementType BLOCK_COM = new SpiceElementType("BLOCK_COM"); IElementType BREAK_STMT = new SpiceElementType("BREAK_STMT"); IElementType BUILTIN_CALL = new SpiceElementType("BUILTIN_CALL"); + IElementType CASE_BRANCH = new SpiceElementType("CASE_BRANCH"); IElementType CAST_EXPR = new SpiceElementType("CAST_EXPR"); IElementType CONSTANT = new SpiceElementType("CONSTANT"); + IElementType CONSTANT_LST = new SpiceElementType("CONSTANT_LST"); IElementType CONTINUE_STMT = new SpiceElementType("CONTINUE_STMT"); IElementType CUSTOM_DATA_TYPE = new SpiceElementType("CUSTOM_DATA_TYPE"); IElementType DATA_TYPE = new SpiceElementType("DATA_TYPE"); IElementType DECL_STMT = new SpiceElementType("DECL_STMT"); + IElementType DEFAULT_BRANCH = new SpiceElementType("DEFAULT_BRANCH"); IElementType DOC_COM = new SpiceElementType("DOC_COM"); IElementType DO_WHILE_LOOP = new SpiceElementType("DO_WHILE_LOOP"); IElementType ELSE_STMT = new SpiceElementType("ELSE_STMT"); @@ -40,7 +43,9 @@ public interface SpiceTypes { IElementType ENUM_ITEM = new SpiceElementType("ENUM_ITEM"); IElementType ENUM_ITEM_LST = new SpiceElementType("ENUM_ITEM_LST"); IElementType EQUALITY_EXPR = new SpiceElementType("EQUALITY_EXPR"); + IElementType EXPR_STMT = new SpiceElementType("EXPR_STMT"); IElementType EXT_DECL = new SpiceElementType("EXT_DECL"); + IElementType FALLTHROUGH_STMT = new SpiceElementType("FALLTHROUGH_STMT"); IElementType FIELD = new SpiceElementType("FIELD"); IElementType FOREACH_HEAD = new SpiceElementType("FOREACH_HEAD"); IElementType FOREACH_LOOP = new SpiceElementType("FOREACH_LOOP"); @@ -54,7 +59,7 @@ public interface SpiceTypes { IElementType GLOBAL_VAR_DEF = new SpiceElementType("GLOBAL_VAR_DEF"); IElementType IDENTIFIER_EXPR = new SpiceElementType("IDENTIFIER_EXPR"); IElementType IF_STMT = new SpiceElementType("IF_STMT"); - IElementType IMPORT_STMT = new SpiceElementType("IMPORT_STMT"); + IElementType IMPORT_DEF = new SpiceElementType("IMPORT_DEF"); IElementType INTERFACE_DEF = new SpiceElementType("INTERFACE_DEF"); IElementType LAMBDA_EXPR = new SpiceElementType("LAMBDA_EXPR"); IElementType LAMBDA_FUNC = new SpiceElementType("LAMBDA_FUNC"); @@ -84,6 +89,7 @@ public interface SpiceTypes { IElementType STMT_LST = new SpiceElementType("STMT_LST"); IElementType STRUCT_DEF = new SpiceElementType("STRUCT_DEF"); IElementType STRUCT_INSTANTIATION = new SpiceElementType("STRUCT_INSTANTIATION"); + IElementType SWITCH_STMT = new SpiceElementType("SWITCH_STMT"); IElementType TERNARY_EXPR = new SpiceElementType("TERNARY_EXPR"); IElementType TOP_LEVEL_DEF_ATTR = new SpiceElementType("TOP_LEVEL_DEF_ATTR"); IElementType TYPE_ALTS_LST = new SpiceElementType("TYPE_ALTS_LST"); @@ -105,12 +111,14 @@ public interface SpiceTypes { IElementType BITWISE_XOR = new SpiceTokenType("BITWISE_XOR"); IElementType BLOCK_COMMENT = new SpiceTokenType("BLOCK_COMMENT"); IElementType BREAK = new SpiceTokenType("BREAK"); + IElementType CASE = new SpiceTokenType("CASE"); IElementType CHAR_LIT = new SpiceTokenType("CHAR_LIT"); IElementType COLON = new SpiceTokenType("COLON"); IElementType COMMA = new SpiceTokenType("COMMA"); IElementType COMPOSE = new SpiceTokenType("COMPOSE"); IElementType CONST = new SpiceTokenType("CONST"); IElementType CONTINUE = new SpiceTokenType("CONTINUE"); + IElementType DEFAULT = new SpiceTokenType("DEFAULT"); IElementType DIV = new SpiceTokenType("DIV"); IElementType DIV_EQUAL = new SpiceTokenType("DIV_EQUAL"); IElementType DO = new SpiceTokenType("DO"); @@ -123,6 +131,7 @@ public interface SpiceTypes { IElementType EQUAL = new SpiceTokenType("EQUAL"); IElementType EXT = new SpiceTokenType("EXT"); IElementType F = new SpiceTokenType("F"); + IElementType FALLTHROUGH = new SpiceTokenType("FALLTHROUGH"); IElementType FALSE = new SpiceTokenType("FALSE"); IElementType FOR = new SpiceTokenType("FOR"); IElementType FOREACH = new SpiceTokenType("FOREACH"); @@ -180,6 +189,7 @@ public interface SpiceTypes { IElementType SIZEOF = new SpiceTokenType("SIZEOF"); IElementType STRING_LIT = new SpiceTokenType("STRING_LIT"); IElementType STRUCT = new SpiceTokenType("STRUCT"); + IElementType SWITCH = new SpiceTokenType("SWITCH"); IElementType TOPLEVEL_ATTR_PREAMBLE = new SpiceTokenType("TOPLEVEL_ATTR_PREAMBLE"); IElementType TRUE = new SpiceTokenType("TRUE"); IElementType TYPE = new SpiceTokenType("TYPE"); @@ -258,12 +268,18 @@ else if (type == BREAK_STMT) { else if (type == BUILTIN_CALL) { return new SpiceBuiltinCallImpl(node); } + else if (type == CASE_BRANCH) { + return new SpiceCaseBranchImpl(node); + } else if (type == CAST_EXPR) { return new SpiceCastExprImpl(node); } else if (type == CONSTANT) { return new SpiceConstantImpl(node); } + else if (type == CONSTANT_LST) { + return new SpiceConstantLstImpl(node); + } else if (type == CONTINUE_STMT) { return new SpiceContinueStmtImpl(node); } @@ -276,6 +292,9 @@ else if (type == DATA_TYPE) { else if (type == DECL_STMT) { return new SpiceDeclStmtImpl(node); } + else if (type == DEFAULT_BRANCH) { + return new SpiceDefaultBranchImpl(node); + } else if (type == DOC_COM) { return new SpiceDocComImpl(node); } @@ -297,9 +316,15 @@ else if (type == ENUM_ITEM_LST) { else if (type == EQUALITY_EXPR) { return new SpiceEqualityExprImpl(node); } + else if (type == EXPR_STMT) { + return new SpiceExprStmtImpl(node); + } else if (type == EXT_DECL) { return new SpiceExtDeclImpl(node); } + else if (type == FALLTHROUGH_STMT) { + return new SpiceFallthroughStmtImpl(node); + } else if (type == FIELD) { return new SpiceFieldImpl(node); } @@ -339,8 +364,8 @@ else if (type == IDENTIFIER_EXPR) { else if (type == IF_STMT) { return new SpiceIfStmtImpl(node); } - else if (type == IMPORT_STMT) { - return new SpiceImportStmtImpl(node); + else if (type == IMPORT_DEF) { + return new SpiceImportDefImpl(node); } else if (type == INTERFACE_DEF) { return new SpiceInterfaceDefImpl(node); @@ -429,6 +454,9 @@ else if (type == STRUCT_DEF) { else if (type == STRUCT_INSTANTIATION) { return new SpiceStructInstantiationImpl(node); } + else if (type == SWITCH_STMT) { + return new SpiceSwitchStmtImpl(node); + } else if (type == TERNARY_EXPR) { return new SpiceTernaryExprImpl(node); } diff --git a/src/main/gen/com/spicelang/intellij/spice/psi/SpiceVisitor.java b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceVisitor.java index d7353bf..f90c443 100644 --- a/src/main/gen/com/spicelang/intellij/spice/psi/SpiceVisitor.java +++ b/src/main/gen/com/spicelang/intellij/spice/psi/SpiceVisitor.java @@ -83,6 +83,10 @@ public void visitBuiltinCall(@NotNull SpiceBuiltinCall o) { visitPsiElement(o); } + public void visitCaseBranch(@NotNull SpiceCaseBranch o) { + visitPsiElement(o); + } + public void visitCastExpr(@NotNull SpiceCastExpr o) { visitPsiElement(o); } @@ -91,6 +95,10 @@ public void visitConstant(@NotNull SpiceConstant o) { visitPsiElement(o); } + public void visitConstantLst(@NotNull SpiceConstantLst o) { + visitPsiElement(o); + } + public void visitContinueStmt(@NotNull SpiceContinueStmt o) { visitPsiElement(o); } @@ -107,6 +115,10 @@ public void visitDeclStmt(@NotNull SpiceDeclStmt o) { visitPsiElement(o); } + public void visitDefaultBranch(@NotNull SpiceDefaultBranch o) { + visitPsiElement(o); + } + public void visitDoWhileLoop(@NotNull SpiceDoWhileLoop o) { visitPsiElement(o); } @@ -135,10 +147,18 @@ public void visitEqualityExpr(@NotNull SpiceEqualityExpr o) { visitPsiElement(o); } + public void visitExprStmt(@NotNull SpiceExprStmt o) { + visitPsiElement(o); + } + public void visitExtDecl(@NotNull SpiceExtDecl o) { visitPsiElement(o); } + public void visitFallthroughStmt(@NotNull SpiceFallthroughStmt o) { + visitPsiElement(o); + } + public void visitField(@NotNull SpiceField o) { visitPsiElement(o); } @@ -191,7 +211,7 @@ public void visitIfStmt(@NotNull SpiceIfStmt o) { visitPsiElement(o); } - public void visitImportStmt(@NotNull SpiceImportStmt o) { + public void visitImportDef(@NotNull SpiceImportDef o) { visitPsiElement(o); } @@ -311,6 +331,10 @@ public void visitStructInstantiation(@NotNull SpiceStructInstantiation o) { visitPsiElement(o); } + public void visitSwitchStmt(@NotNull SpiceSwitchStmt o) { + visitPsiElement(o); + } + public void visitTernaryExpr(@NotNull SpiceTernaryExpr o) { visitPsiElement(o); } diff --git a/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceCaseBranchImpl.java b/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceCaseBranchImpl.java new file mode 100644 index 0000000..3adc737 --- /dev/null +++ b/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceCaseBranchImpl.java @@ -0,0 +1,42 @@ +// This is a generated file. Not intended for manual editing. +package com.spicelang.intellij.spice.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 com.spicelang.intellij.spice.psi.SpiceTypes.*; +import com.intellij.extapi.psi.ASTWrapperPsiElement; +import com.spicelang.intellij.spice.psi.*; + +public class SpiceCaseBranchImpl extends ASTWrapperPsiElement implements SpiceCaseBranch { + + public SpiceCaseBranchImpl(@NotNull ASTNode node) { + super(node); + } + + public void accept(@NotNull SpiceVisitor visitor) { + visitor.visitCaseBranch(this); + } + + @Override + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof SpiceVisitor) accept((SpiceVisitor)visitor); + else super.accept(visitor); + } + + @Override + @NotNull + public SpiceConstantLst getConstantLst() { + return findNotNullChildByClass(SpiceConstantLst.class); + } + + @Override + @NotNull + public SpiceStmtLst getStmtLst() { + return findNotNullChildByClass(SpiceStmtLst.class); + } + +} diff --git a/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceConstantLstImpl.java b/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceConstantLstImpl.java new file mode 100644 index 0000000..502700a --- /dev/null +++ b/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceConstantLstImpl.java @@ -0,0 +1,36 @@ +// This is a generated file. Not intended for manual editing. +package com.spicelang.intellij.spice.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 com.spicelang.intellij.spice.psi.SpiceTypes.*; +import com.intellij.extapi.psi.ASTWrapperPsiElement; +import com.spicelang.intellij.spice.psi.*; + +public class SpiceConstantLstImpl extends ASTWrapperPsiElement implements SpiceConstantLst { + + public SpiceConstantLstImpl(@NotNull ASTNode node) { + super(node); + } + + public void accept(@NotNull SpiceVisitor visitor) { + visitor.visitConstantLst(this); + } + + @Override + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof SpiceVisitor) accept((SpiceVisitor)visitor); + else super.accept(visitor); + } + + @Override + @NotNull + public List getConstantList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, SpiceConstant.class); + } + +} diff --git a/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceDefaultBranchImpl.java b/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceDefaultBranchImpl.java new file mode 100644 index 0000000..5f645ad --- /dev/null +++ b/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceDefaultBranchImpl.java @@ -0,0 +1,36 @@ +// This is a generated file. Not intended for manual editing. +package com.spicelang.intellij.spice.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 com.spicelang.intellij.spice.psi.SpiceTypes.*; +import com.intellij.extapi.psi.ASTWrapperPsiElement; +import com.spicelang.intellij.spice.psi.*; + +public class SpiceDefaultBranchImpl extends ASTWrapperPsiElement implements SpiceDefaultBranch { + + public SpiceDefaultBranchImpl(@NotNull ASTNode node) { + super(node); + } + + public void accept(@NotNull SpiceVisitor visitor) { + visitor.visitDefaultBranch(this); + } + + @Override + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof SpiceVisitor) accept((SpiceVisitor)visitor); + else super.accept(visitor); + } + + @Override + @NotNull + public SpiceStmtLst getStmtLst() { + return findNotNullChildByClass(SpiceStmtLst.class); + } + +} diff --git a/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceExprStmtImpl.java b/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceExprStmtImpl.java new file mode 100644 index 0000000..7968525 --- /dev/null +++ b/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceExprStmtImpl.java @@ -0,0 +1,36 @@ +// This is a generated file. Not intended for manual editing. +package com.spicelang.intellij.spice.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 com.spicelang.intellij.spice.psi.SpiceTypes.*; +import com.intellij.extapi.psi.ASTWrapperPsiElement; +import com.spicelang.intellij.spice.psi.*; + +public class SpiceExprStmtImpl extends ASTWrapperPsiElement implements SpiceExprStmt { + + public SpiceExprStmtImpl(@NotNull ASTNode node) { + super(node); + } + + public void accept(@NotNull SpiceVisitor visitor) { + visitor.visitExprStmt(this); + } + + @Override + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof SpiceVisitor) accept((SpiceVisitor)visitor); + else super.accept(visitor); + } + + @Override + @NotNull + public SpiceAssignExpr getAssignExpr() { + return findNotNullChildByClass(SpiceAssignExpr.class); + } + +} diff --git a/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceFallthroughStmtImpl.java b/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceFallthroughStmtImpl.java new file mode 100644 index 0000000..ced05ba --- /dev/null +++ b/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceFallthroughStmtImpl.java @@ -0,0 +1,30 @@ +// This is a generated file. Not intended for manual editing. +package com.spicelang.intellij.spice.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 com.spicelang.intellij.spice.psi.SpiceTypes.*; +import com.intellij.extapi.psi.ASTWrapperPsiElement; +import com.spicelang.intellij.spice.psi.*; + +public class SpiceFallthroughStmtImpl extends ASTWrapperPsiElement implements SpiceFallthroughStmt { + + public SpiceFallthroughStmtImpl(@NotNull ASTNode node) { + super(node); + } + + public void accept(@NotNull SpiceVisitor visitor) { + visitor.visitFallthroughStmt(this); + } + + @Override + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof SpiceVisitor) accept((SpiceVisitor)visitor); + else super.accept(visitor); + } + +} diff --git a/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceImportStmtImpl.java b/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceImportDefImpl.java similarity index 80% rename from src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceImportStmtImpl.java rename to src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceImportDefImpl.java index 4eda56f..daf1585 100644 --- a/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceImportStmtImpl.java +++ b/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceImportDefImpl.java @@ -11,14 +11,14 @@ import com.intellij.extapi.psi.ASTWrapperPsiElement; import com.spicelang.intellij.spice.psi.*; -public class SpiceImportStmtImpl extends ASTWrapperPsiElement implements SpiceImportStmt { +public class SpiceImportDefImpl extends ASTWrapperPsiElement implements SpiceImportDef { - public SpiceImportStmtImpl(@NotNull ASTNode node) { + public SpiceImportDefImpl(@NotNull ASTNode node) { super(node); } public void accept(@NotNull SpiceVisitor visitor) { - visitor.visitImportStmt(this); + visitor.visitImportDef(this); } @Override diff --git a/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceStmtImpl.java b/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceStmtImpl.java index c10ac63..e104d5b 100644 --- a/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceStmtImpl.java +++ b/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceStmtImpl.java @@ -27,12 +27,6 @@ public void accept(@NotNull PsiElementVisitor visitor) { else super.accept(visitor); } - @Override - @Nullable - public SpiceAssignExpr getAssignExpr() { - return findChildByClass(SpiceAssignExpr.class); - } - @Override @Nullable public SpiceBreakStmt getBreakStmt() { @@ -51,6 +45,18 @@ public SpiceDeclStmt getDeclStmt() { return findChildByClass(SpiceDeclStmt.class); } + @Override + @Nullable + public SpiceExprStmt getExprStmt() { + return findChildByClass(SpiceExprStmt.class); + } + + @Override + @Nullable + public SpiceFallthroughStmt getFallthroughStmt() { + return findChildByClass(SpiceFallthroughStmt.class); + } + @Override @Nullable public SpiceReturnStmt getReturnStmt() { diff --git a/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceStmtLstImpl.java b/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceStmtLstImpl.java index 0d2ffae..166d1ad 100644 --- a/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceStmtLstImpl.java +++ b/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceStmtLstImpl.java @@ -69,6 +69,12 @@ public List getStmtList() { return PsiTreeUtil.getChildrenOfTypeAsList(this, SpiceStmt.class); } + @Override + @NotNull + public List getSwitchStmtList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, SpiceSwitchStmt.class); + } + @Override @NotNull public List getUnsafeBlockList() { diff --git a/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceSwitchStmtImpl.java b/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceSwitchStmtImpl.java new file mode 100644 index 0000000..64d9e67 --- /dev/null +++ b/src/main/gen/com/spicelang/intellij/spice/psi/impl/SpiceSwitchStmtImpl.java @@ -0,0 +1,48 @@ +// This is a generated file. Not intended for manual editing. +package com.spicelang.intellij.spice.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 com.spicelang.intellij.spice.psi.SpiceTypes.*; +import com.intellij.extapi.psi.ASTWrapperPsiElement; +import com.spicelang.intellij.spice.psi.*; + +public class SpiceSwitchStmtImpl extends ASTWrapperPsiElement implements SpiceSwitchStmt { + + public SpiceSwitchStmtImpl(@NotNull ASTNode node) { + super(node); + } + + public void accept(@NotNull SpiceVisitor visitor) { + visitor.visitSwitchStmt(this); + } + + @Override + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof SpiceVisitor) accept((SpiceVisitor)visitor); + else super.accept(visitor); + } + + @Override + @NotNull + public SpiceAssignExpr getAssignExpr() { + return findNotNullChildByClass(SpiceAssignExpr.class); + } + + @Override + @NotNull + public List getCaseBranchList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, SpiceCaseBranch.class); + } + + @Override + @Nullable + public SpiceDefaultBranch getDefaultBranch() { + return findChildByClass(SpiceDefaultBranch.class); + } + +} diff --git a/src/main/java/com/spicelang/intellij/spice/Spice.bnf b/src/main/java/com/spicelang/intellij/spice/Spice.bnf index 88b4a9f..d9333b5 100644 --- a/src/main/java/com/spicelang/intellij/spice/Spice.bnf +++ b/src/main/java/com/spicelang/intellij/spice/Spice.bnf @@ -19,7 +19,7 @@ } // Top level definitions and declarations -spiceFile ::= (mainFunctionDef | functionDef | procedureDef | structDef | interfaceDef | enumDef | genericTypeDef | aliasDef | globalVarDef | importStmt | extDecl | modAttr | docCom | lineCom | blockCom)* +spiceFile ::= (mainFunctionDef | functionDef | procedureDef | structDef | interfaceDef | enumDef | genericTypeDef | aliasDef | globalVarDef | importDef | extDecl | modAttr | docCom | lineCom | blockCom)* docCom ::= DOC_COMMENT lineCom ::= LINE_COMMENT blockCom ::= BLOCK_COMMENT @@ -34,6 +34,7 @@ genericTypeDef ::= TYPE TYPE_IDENTIFIER typeAltsLst SEMICOLON aliasDef ::= specifierLst? TYPE TYPE_IDENTIFIER ALIAS dataType SEMICOLON globalVarDef ::= dataType TYPE_IDENTIFIER (ASSIGN MINUS? value)? SEMICOLON extDecl ::= topLevelDefAttr? EXT (F LESS dataType GREATER | P) (IDENTIFIER | TYPE_IDENTIFIER) LPAREN (typeLst ELLIPSIS?)? RPAREN SEMICOLON +importDef ::= IMPORT STRING_LIT (AS IDENTIFIER)? SEMICOLON // Control structures unsafeBlock ::= UNSAFE LBRACE stmtLst RBRACE @@ -45,10 +46,13 @@ whileLoop ::= WHILE assignExpr LBRACE stmtLst RBRACE doWhileLoop ::= DO LBRACE stmtLst RBRACE WHILE assignExpr SEMICOLON ifStmt ::= IF assignExpr LBRACE stmtLst RBRACE elseStmt? elseStmt ::= ELSE ifStmt | ELSE LBRACE stmtLst RBRACE +switchStmt ::= SWITCH assignExpr LBRACE caseBranch* defaultBranch? RBRACE +caseBranch ::= CASE constantLst COLON stmtLst +defaultBranch ::= DEFAULT COLON stmtLst anonymousBlockStmt ::= LBRACE stmtLst RBRACE; // Statements, declarations, definitions and lists -stmtLst ::= (stmt | forLoop | foreachLoop | whileLoop | doWhileLoop | ifStmt | assertStmt | unsafeBlock | anonymousBlockStmt)* +stmtLst ::= (stmt | forLoop | foreachLoop | whileLoop | doWhileLoop | ifStmt | switchStmt | assertStmt | unsafeBlock | anonymousBlockStmt)* typeLst ::= dataType (COMMA dataType)* typeAltsLst ::= dataType (BITWISE_OR dataType)*; paramLst ::= declStmt (COMMA declStmt)* @@ -57,18 +61,20 @@ enumItemLst ::= enumItem (COMMA enumItem)* enumItem ::= TYPE_IDENTIFIER (ASSIGN INT_LIT)? field ::= dataType IDENTIFIER (ASSIGN assignExpr)? signature ::= specifierLst? (F LESS dataType GREATER | P) IDENTIFIER (LESS typeLst GREATER)? LPAREN typeLst? RPAREN SEMICOLON -stmt ::= (declStmt | assignExpr | returnStmt | breakStmt | continueStmt) SEMICOLON +stmt ::= (declStmt | returnStmt | breakStmt | continueStmt | fallthroughStmt | exprStmt) SEMICOLON declStmt ::= dataType IDENTIFIER (ASSIGN assignExpr)? +exprStmt ::= assignExpr specifierLst ::= specifier+ specifier ::= CONST | SIGNED | UNSIGNED | INLINE | PUBLIC | HEAP | COMPOSE modAttr ::= MOD_ATTR_PREAMBLE LBRACKET attrLst RBRACKET topLevelDefAttr ::= TOPLEVEL_ATTR_PREAMBLE LBRACKET attrLst RBRACKET attrLst ::= attr (COMMA attr)* attr ::= IDENTIFIER (DOT IDENTIFIER)* (ASSIGN constant)? -importStmt ::= IMPORT STRING_LIT (AS IDENTIFIER)? SEMICOLON +constantLst ::= constant (COMMA constant)* returnStmt ::= RETURN assignExpr? breakStmt ::= BREAK INT_LIT? continueStmt ::= CONTINUE INT_LIT? +fallthroughStmt ::= FALLTHROUGH assertStmt ::= ASSERT assignExpr SEMICOLON // Builtin functions diff --git a/src/main/java/com/spicelang/intellij/spice/Spice.flex b/src/main/java/com/spicelang/intellij/spice/Spice.flex index d697d5e..be491ba 100644 --- a/src/main/java/com/spicelang/intellij/spice/Spice.flex +++ b/src/main/java/com/spicelang/intellij/spice/Spice.flex @@ -61,6 +61,9 @@ f { return SpiceTypes.F; } p { return SpiceTypes.P; } if { return SpiceTypes.IF; } else { return SpiceTypes.ELSE; } +switch { return SpiceTypes.SWITCH; } +case { return SpiceTypes.CASE; } +default { return SpiceTypes.DEFAULT; } assert { return SpiceTypes.ASSERT; } for { return SpiceTypes.FOR; } foreach { return SpiceTypes.FOREACH; } @@ -69,6 +72,7 @@ while { return SpiceTypes.WHILE; } import { return SpiceTypes.IMPORT; } break { return SpiceTypes.BREAK; } continue { return SpiceTypes.CONTINUE; } +fallthrough { return SpiceTypes.FALLTHROUGH; } return { return SpiceTypes.RETURN; } as { return SpiceTypes.AS; } struct { return SpiceTypes.STRUCT; } diff --git a/src/main/java/com/spicelang/intellij/spice/SpiceSyntaxHighlighter.java b/src/main/java/com/spicelang/intellij/spice/SpiceSyntaxHighlighter.java index 247a342..de33898 100644 --- a/src/main/java/com/spicelang/intellij/spice/SpiceSyntaxHighlighter.java +++ b/src/main/java/com/spicelang/intellij/spice/SpiceSyntaxHighlighter.java @@ -91,6 +91,9 @@ public Lexer getHighlightingLexer() { if (tokenType.equals(SpiceTypes.P)) return KEYWORD_KEY; if (tokenType.equals(SpiceTypes.IF)) return KEYWORD_KEY; if (tokenType.equals(SpiceTypes.ELSE)) return KEYWORD_KEY; + if (tokenType.equals(SpiceTypes.SWITCH)) return KEYWORD_KEY; + if (tokenType.equals(SpiceTypes.CASE)) return KEYWORD_KEY; + if (tokenType.equals(SpiceTypes.DEFAULT)) return KEYWORD_KEY; if (tokenType.equals(SpiceTypes.ASSERT)) return KEYWORD_KEY; if (tokenType.equals(SpiceTypes.FOR)) return KEYWORD_KEY; if (tokenType.equals(SpiceTypes.FOREACH)) return KEYWORD_KEY; @@ -99,6 +102,7 @@ public Lexer getHighlightingLexer() { if (tokenType.equals(SpiceTypes.IMPORT)) return KEYWORD_KEY; if (tokenType.equals(SpiceTypes.BREAK)) return KEYWORD_KEY; if (tokenType.equals(SpiceTypes.CONTINUE)) return KEYWORD_KEY; + if (tokenType.equals(SpiceTypes.FALLTHROUGH)) return KEYWORD_KEY; if (tokenType.equals(SpiceTypes.RETURN)) return KEYWORD_KEY; if (tokenType.equals(SpiceTypes.AS)) return KEYWORD_KEY; if (tokenType.equals(SpiceTypes.STRUCT)) return KEYWORD_KEY;