diff --git a/src/main/gen/de/platon42/intellij/plugins/m68k/lexer/_M68kLexer.java b/src/main/gen/de/platon42/intellij/plugins/m68k/lexer/_M68kLexer.java index 2d54a13..3ab181c 100644 --- a/src/main/gen/de/platon42/intellij/plugins/m68k/lexer/_M68kLexer.java +++ b/src/main/gen/de/platon42/intellij/plugins/m68k/lexer/_M68kLexer.java @@ -36,11 +36,12 @@ public class _M68kLexer implements FlexLexer { public static final int INSTRPART = 4; public static final int ASMINSTR = 6; public static final int ASMOPS = 8; - public static final int ASSIGNMENT = 10; - public static final int EXPR = 12; - public static final int EXPR_OP = 14; - public static final int MACROCALL = 16; - public static final int WAITEOL = 18; + public static final int ASMOPS_OP = 10; + public static final int ASSIGNMENT = 12; + public static final int EXPR = 14; + public static final int EXPR_OP = 16; + public static final int MACROCALL = 18; + public static final int WAITEOL = 20; /** * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l @@ -50,7 +51,7 @@ public class _M68kLexer implements FlexLexer { */ private static final int ZZ_LEXSTATE[] = { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, - 8, 8, 9, 9 + 8, 8, 9, 9, 10, 10 }; /** @@ -189,25 +190,27 @@ public class _M68kLexer implements FlexLexer { private static final int[] ZZ_ACTION = zzUnpackAction(); private static final String ZZ_ACTION_PACKED_0 = - "\12\0\1\1\2\2\1\3\1\4\1\1\1\5\2\6" + + "\13\0\1\1\2\2\1\3\1\4\1\1\1\5\2\6" + "\1\2\1\7\1\10\1\1\1\11\2\12\1\7\1\10" + - "\1\13\1\14\1\1\1\15\1\16\5\15\1\17\1\15" + - "\1\1\1\20\4\1\1\21\1\22\1\23\1\24\1\25" + - "\1\26\1\27\1\30\1\31\1\32\1\33\1\34\1\35" + - "\1\36\1\37\2\15\2\1\1\40\1\41\1\42\6\1" + - "\1\43\1\30\1\44\1\40\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\53\1\61\1\62\1\12\4\62\1\0\1\63\1\4" + - "\2\64\3\0\1\65\1\66\1\67\1\70\1\71\1\72" + - "\1\73\1\15\1\74\1\65\1\66\1\67\1\75\1\76" + - "\1\77\1\0\1\62\5\0\1\100\1\101\1\102\1\103" + - "\1\104\1\105\1\106\1\20\2\15\2\0\1\107\1\110" + - "\1\111\1\0\1\112\5\0\1\113\1\114\1\115\1\116" + - "\1\117\1\120\1\121\1\122\3\62\1\0\1\62\2\0" + - "\1\4\1\64\1\7\1\123\1\124\1\125\1\126\4\0"; + "\1\13\1\14\1\1\1\15\1\16\5\15\6\1\1\17" + + "\1\20\1\21\1\22\1\23\1\24\1\25\1\26\1\27" + + "\1\30\2\15\1\31\1\1\1\31\1\32\1\33\1\34" + + "\1\35\1\36\1\37\1\40\1\41\1\42\1\43\1\44" + + "\1\45\1\46\1\41\1\47\2\1\1\50\1\51\1\52" + + "\6\1\1\53\1\54\1\1\1\55\1\56\1\57\1\60" + + "\1\61\1\62\1\63\1\64\1\65\1\66\1\67\1\70" + + "\1\63\1\71\1\72\1\12\4\72\1\0\1\73\1\4" + + "\2\74\3\0\1\75\1\76\1\77\1\100\1\101\1\102" + + "\1\103\1\15\1\104\1\105\1\106\1\0\1\107\5\0" + + "\2\15\1\110\1\75\1\76\1\77\1\111\1\112\1\113" + + "\1\114\1\115\1\116\1\117\2\0\1\120\1\121\1\122" + + "\1\0\1\123\5\0\1\124\1\125\1\126\1\127\1\130" + + "\1\131\1\132\1\133\1\0\1\72\1\0\1\72\1\0" + + "\1\72\1\0\1\72\2\0\1\4\1\74\1\7\1\134" + + "\1\135\1\136\1\137\1\72\7\0"; private static int[] zzUnpackAction() { - int[] result = new int[176]; + int[] result = new int[193]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; @@ -233,30 +236,33 @@ public class _M68kLexer implements FlexLexer { private static final String ZZ_ROWMAP_PACKED_0 = "\0\0\0\72\0\164\0\256\0\350\0\u0122\0\u015c\0\u0196" + - "\0\u01d0\0\u020a\0\u0244\0\u0244\0\u027e\0\u02b8\0\u02f2\0\u032c" + - "\0\u0366\0\u0244\0\u03a0\0\u03da\0\u0414\0\u044e\0\u0488\0\u04c2" + - "\0\u0244\0\u04fc\0\u0536\0\u0570\0\u05aa\0\u05e4\0\u061e\0\u0658" + + "\0\u01d0\0\u020a\0\u0244\0\u027e\0\u027e\0\u02b8\0\u02f2\0\u032c" + + "\0\u0366\0\u03a0\0\u027e\0\u03da\0\u0414\0\u044e\0\u0488\0\u04c2" + + "\0\u04fc\0\u027e\0\u0536\0\u0570\0\u05aa\0\u05e4\0\u061e\0\u0658" + "\0\u0692\0\u06cc\0\u0706\0\u0740\0\u077a\0\u07b4\0\u07ee\0\u0828" + - "\0\u0862\0\u089c\0\u08d6\0\u0910\0\u094a\0\u0984\0\u09be\0\u09f8" + - "\0\u0244\0\u0244\0\u0244\0\u0244\0\u0244\0\u0a32\0\u0244\0\u0244" + - "\0\u0244\0\u0244\0\u0a6c\0\u0aa6\0\u0ae0\0\u0b1a\0\u0b54\0\u0b8e" + - "\0\u0bc8\0\u0244\0\u0c02\0\u0c3c\0\u0c76\0\u0cb0\0\u0cea\0\u0d24" + - "\0\u0d5e\0\u0d98\0\u0244\0\u0244\0\u0244\0\u0dd2\0\u0244\0\u0e0c" + - "\0\u0e46\0\u0244\0\u0244\0\u0244\0\u0e80\0\u0244\0\u0244\0\u0244" + - "\0\u0244\0\u0eba\0\u0ef4\0\u0f2e\0\u0f68\0\u0f68\0\u0fa2\0\u0fdc" + - "\0\u1016\0\u1050\0\u108a\0\u10c4\0\u10fe\0\u1138\0\u1172\0\u11ac" + - "\0\u1138\0\u11e6\0\u0244\0\u0244\0\u0244\0\u077a\0\u077a\0\u077a" + - "\0\u077a\0\u1220\0\u0244\0\u077a\0\u077a\0\u077a\0\u0862\0\u089c" + - "\0\u08d6\0\u0910\0\u0244\0\u125a\0\u094a\0\u1294\0\u0984\0\u12ce" + - "\0\u0244\0\u0244\0\u0244\0\u0244\0\u0244\0\u0244\0\u0244\0\u0244" + - "\0\u1308\0\u1342\0\u137c\0\u13b6\0\u0c76\0\u0cb0\0\u0cea\0\u0d24" + - "\0\u0244\0\u13f0\0\u0d5e\0\u142a\0\u0d98\0\u1464\0\u0244\0\u0244" + - "\0\u0244\0\u0244\0\u0244\0\u0244\0\u0244\0\u0244\0\u149e\0\u14d8" + - "\0\u1512\0\u154c\0\u1586\0\u15c0\0\u15fa\0\u0244\0\u0244\0\u0244" + - "\0\u077a\0\u077a\0\u077a\0\u0244\0\u1634\0\u166e\0\u16a8\0\u10c4"; + "\0\u0862\0\u089c\0\u08d6\0\u0910\0\u094a\0\u027e\0\u027e\0\u027e" + + "\0\u027e\0\u027e\0\u027e\0\u027e\0\u027e\0\u027e\0\u027e\0\u0984" + + "\0\u09be\0\u09f8\0\u0a32\0\u0a6c\0\u027e\0\u0aa6\0\u0ae0\0\u027e" + + "\0\u027e\0\u027e\0\u027e\0\u0b1a\0\u027e\0\u027e\0\u027e\0\u027e" + + "\0\u0b54\0\u0b8e\0\u0bc8\0\u0c02\0\u0c3c\0\u027e\0\u0c76\0\u0cb0" + + "\0\u0cea\0\u0d24\0\u0d5e\0\u0d98\0\u0dd2\0\u0e0c\0\u027e\0\u027e" + + "\0\u0e46\0\u027e\0\u0e80\0\u0eba\0\u027e\0\u027e\0\u027e\0\u0ef4" + + "\0\u027e\0\u027e\0\u027e\0\u027e\0\u0f2e\0\u0f68\0\u0fa2\0\u0fdc" + + "\0\u0fdc\0\u1016\0\u1050\0\u108a\0\u10c4\0\u10fe\0\u1138\0\u1172" + + "\0\u11ac\0\u11e6\0\u1220\0\u11ac\0\u125a\0\u027e\0\u027e\0\u027e" + + "\0\u07b4\0\u07b4\0\u07b4\0\u07b4\0\u1294\0\u0828\0\u0862\0\u089c" + + "\0\u08d6\0\u027e\0\u12ce\0\u0910\0\u1308\0\u094a\0\u1342\0\u137c" + + "\0\u13b6\0\u027e\0\u09f8\0\u09f8\0\u09f8\0\u027e\0\u027e\0\u027e" + + "\0\u027e\0\u027e\0\u027e\0\u027e\0\u13f0\0\u142a\0\u0cea\0\u0d24" + + "\0\u0d5e\0\u0d98\0\u027e\0\u1464\0\u0dd2\0\u149e\0\u0e0c\0\u14d8" + + "\0\u027e\0\u027e\0\u027e\0\u027e\0\u027e\0\u027e\0\u027e\0\u027e" + + "\0\u1512\0\u154c\0\u1586\0\u15c0\0\u15fa\0\u1634\0\u166e\0\u16a8" + + "\0\u16e2\0\u171c\0\u027e\0\u027e\0\u027e\0\u07b4\0\u07b4\0\u07b4" + + "\0\u027e\0\u027e\0\u1756\0\u1790\0\u17ca\0\u1804\0\u183e\0\u1878" + + "\0\u1138"; private static int[] zzUnpackRowMap() { - int[] result = new int[176]; + int[] result = new int[193]; int offset = 0; offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); return result; @@ -279,102 +285,110 @@ public class _M68kLexer implements FlexLexer { private static final int[] ZZ_TRANS = zzUnpackTrans(); private static final String ZZ_TRANS_PACKED_0 = - "\1\13\2\14\1\15\1\16\1\17\1\13\5\17\1\13" + - "\4\17\1\13\1\20\2\13\4\17\2\13\3\17\1\13" + - "\1\17\10\13\2\21\7\13\1\21\3\13\5\17\1\13" + - "\2\22\1\23\1\24\1\25\1\13\4\25\1\26\1\13" + - "\4\25\1\13\1\27\2\13\4\25\2\13\3\25\1\13" + - "\1\25\10\13\2\30\7\13\1\30\3\13\5\25\1\13" + - "\2\31\1\32\1\24\1\33\1\13\4\33\1\34\1\13" + - "\4\33\4\13\4\33\2\13\3\33\1\13\1\33\10\13" + - "\1\35\14\13\5\33\1\13\2\31\1\32\1\36\15\13" + - "\1\37\25\13\1\35\22\13\2\31\1\32\1\24\1\40" + - "\1\41\1\42\1\43\1\44\2\45\1\13\2\45\1\46" + - "\1\45\1\47\1\50\1\13\1\51\1\42\3\45\1\52" + - "\1\41\1\40\1\44\1\45\1\41\1\45\1\53\1\54" + - "\1\13\1\55\1\56\1\57\1\60\1\61\1\35\1\62" + - "\1\63\1\64\1\65\1\66\1\67\1\70\1\71\1\72" + - "\1\73\1\74\1\75\2\76\1\45\1\77\1\45\1\13" + - "\2\31\1\32\1\24\2\13\1\100\5\13\1\101\3\13" + - "\1\102\3\13\1\100\11\13\1\101\10\13\1\35\22\13" + - "\2\31\1\32\1\24\1\103\1\104\5\103\1\13\4\103" + - "\1\13\1\103\1\13\1\105\4\103\1\106\1\104\3\103" + - "\1\104\1\103\1\107\1\110\1\13\1\111\1\112\2\13" + - "\1\61\1\35\1\13\1\63\1\64\1\113\1\114\1\67" + - "\1\70\1\71\1\115\3\13\5\103\1\13\2\31\1\32" + - "\1\24\14\13\1\116\7\13\1\117\13\13\1\120\1\121" + - "\1\122\1\35\1\13\1\123\1\124\1\65\1\125\1\126" + - "\1\127\1\130\1\131\1\132\1\133\1\134\5\13\1\135" + - "\1\136\1\31\1\32\1\24\34\135\1\137\1\135\1\140" + - "\1\141\1\142\1\135\1\61\1\35\21\135\1\13\2\31" + - "\1\32\66\13\74\0\1\14\73\0\1\16\71\0\1\143" + - "\14\17\1\144\1\0\1\145\1\146\4\17\1\0\6\17" + - "\25\0\5\17\5\0\1\147\1\0\5\147\1\0\4\147" + - "\4\0\4\147\2\0\3\147\1\0\1\147\25\0\5\147" + - "\1\21\3\0\66\21\2\0\1\22\73\0\1\24\72\0" + - "\1\25\1\26\4\25\2\26\4\25\1\0\1\150\1\145" + - "\1\151\4\25\1\0\1\26\3\25\1\26\1\25\25\0" + - "\5\25\5\0\14\26\2\0\1\145\1\151\4\26\1\0" + - "\6\26\25\0\5\26\5\0\1\152\1\0\5\152\1\0" + - "\4\152\4\0\4\152\2\0\3\152\1\0\1\152\25\0" + - "\5\152\1\30\3\0\66\30\2\0\1\31\74\0\1\33" + - "\1\34\4\33\2\34\4\33\1\0\1\150\2\0\4\33" + - "\1\0\1\34\3\33\1\34\1\33\25\0\5\33\5\0" + - "\14\34\4\0\4\34\1\0\6\34\25\0\5\34\1\35" + - "\3\0\66\35\4\0\1\36\112\0\2\153\1\154\1\155" + - "\46\0\1\45\1\156\12\45\3\0\5\45\1\0\1\156" + - "\5\45\25\0\5\45\6\0\1\41\23\0\1\41\3\0" + - "\1\41\40\0\3\45\1\156\10\45\3\0\5\45\1\0" + - "\6\45\25\0\2\45\1\157\2\45\5\0\14\45\3\0" + - "\5\45\1\0\6\45\25\0\2\160\3\45\5\0\1\45" + - "\1\161\12\45\3\0\5\45\1\0\1\161\5\45\25\0" + - "\5\45\5\0\14\45\3\0\5\45\1\0\6\45\25\0" + - "\5\45\5\0\2\45\1\162\11\45\3\0\1\45\1\162" + - "\3\45\1\0\6\45\25\0\5\45\21\0\1\163\55\0" + - "\14\45\3\0\1\45\2\164\1\165\1\166\1\0\6\45" + - "\25\0\5\45\6\0\1\167\17\0\1\167\3\0\6\167" + - "\26\0\1\167\35\0\1\170\45\0\1\171\23\0\1\171" + - "\37\0\41\172\1\173\1\174\27\172\42\175\1\176\1\173" + - "\26\175\42\177\1\200\1\177\1\173\25\177\21\0\1\201" + - "\23\0\1\202\1\203\44\0\1\204\24\0\1\205\44\0" + - "\1\203\132\0\1\206\72\0\1\207\72\0\1\210\12\0" + - "\14\45\3\0\5\45\1\0\6\45\25\0\2\211\3\45" + - "\5\0\14\45\3\0\2\45\1\212\2\45\1\0\6\45" + - "\25\0\4\45\1\212\15\0\1\213\21\0\1\213\50\0" + - "\1\214\60\0\14\103\3\0\5\103\1\0\6\103\25\0" + - "\5\103\6\0\1\104\23\0\1\104\3\0\1\104\41\0" + - "\1\215\17\0\1\215\3\0\6\215\26\0\1\215\35\0" + - "\1\216\45\0\1\217\23\0\1\217\37\0\41\220\1\221" + - "\1\222\27\220\42\223\1\224\1\221\26\223\42\225\1\226" + - "\1\225\1\221\25\225\21\0\1\227\71\0\1\230\23\0" + - "\1\231\1\232\44\0\1\233\24\0\1\234\44\0\1\232" + - "\132\0\1\235\72\0\1\236\72\0\1\117\5\0\2\135" + - "\3\0\42\135\2\0\21\135\2\137\3\172\34\137\1\135" + - "\1\237\4\137\2\172\21\137\2\140\3\175\35\140\1\240" + - "\1\135\3\140\2\175\21\140\2\141\3\177\35\141\1\241" + - "\1\141\1\135\2\141\2\177\21\141\2\142\3\242\35\142" + - "\1\243\3\142\1\135\2\242\21\142\4\0\1\143\2\0" + - "\1\244\5\0\1\245\3\0\1\144\3\0\1\244\11\0" + - "\1\245\36\0\1\144\110\0\1\246\71\0\1\247\53\0" + - "\14\147\2\0\1\247\1\0\4\147\1\0\6\147\25\0" + - "\5\147\1\250\3\0\66\250\5\0\14\152\2\0\1\247" + - "\1\0\4\152\1\0\6\152\25\0\5\152\5\0\3\45" + - "\1\251\10\45\3\0\5\45\1\0\6\45\25\0\5\45" + - "\1\172\3\0\66\172\1\175\3\0\66\175\1\177\3\0" + - "\66\177\5\0\14\45\3\0\5\45\1\0\6\45\25\0" + - "\2\45\1\252\2\45\5\0\14\45\3\0\5\45\1\0" + - "\6\45\25\0\2\45\1\253\2\45\20\0\1\254\70\0" + - "\1\254\52\0\1\220\3\0\66\220\1\223\3\0\66\223" + - "\1\225\3\0\66\225\1\137\1\135\2\0\1\172\42\137" + - "\2\172\21\137\1\140\1\135\2\0\1\175\42\140\2\175" + - "\21\140\1\141\1\135\2\0\1\177\42\141\2\177\21\141" + - "\42\242\1\255\3\242\1\173\23\242\1\142\1\135\2\0" + - "\1\242\42\142\2\242\21\142\15\0\1\256\21\0\1\256" + - "\50\0\1\257\53\0\1\242\3\0\66\242\20\0\1\260" + - "\70\0\1\260\52\0"; + "\1\14\2\15\1\16\1\17\1\20\1\14\5\20\1\14" + + "\4\20\1\14\1\21\2\14\4\20\2\14\3\20\1\14" + + "\1\20\10\14\2\22\7\14\1\22\3\14\5\20\1\14" + + "\2\23\1\24\1\25\1\26\1\14\4\26\1\27\1\14" + + "\4\26\1\14\1\30\2\14\4\26\2\14\3\26\1\14" + + "\1\26\10\14\2\31\7\14\1\31\3\14\5\26\1\14" + + "\2\32\1\33\1\25\1\34\1\14\4\34\1\35\1\14" + + "\4\34\4\14\4\34\2\14\3\34\1\14\1\34\10\14" + + "\1\36\14\14\5\34\1\14\2\32\1\33\1\37\15\14" + + "\1\40\25\14\1\36\22\14\2\32\1\33\1\25\1\41" + + "\1\42\1\43\1\44\1\45\2\46\1\14\2\46\1\47" + + "\1\46\1\14\1\46\1\14\1\50\1\43\3\46\1\51" + + "\1\42\1\41\1\45\1\46\1\42\1\46\1\52\1\53" + + "\1\14\1\54\1\55\2\14\1\56\1\36\1\57\1\60" + + "\1\61\1\62\1\63\1\64\1\65\1\66\1\67\3\14" + + "\2\70\1\46\1\71\1\46\1\14\2\32\1\33\1\25" + + "\1\72\1\14\5\72\1\14\4\72\1\73\1\74\2\14" + + "\4\72\1\75\1\14\3\72\1\14\1\72\5\14\1\76" + + "\1\77\1\100\1\36\1\14\1\101\1\102\1\103\1\104" + + "\1\105\1\106\1\107\1\110\1\111\1\112\1\113\5\72" + + "\1\14\2\32\1\33\1\25\2\14\1\114\5\14\1\115" + + "\3\14\1\116\3\14\1\114\11\14\1\115\10\14\1\36" + + "\22\14\2\32\1\33\1\25\1\117\1\120\5\117\1\14" + + "\4\117\1\14\1\117\1\14\1\121\4\117\1\122\1\120" + + "\3\117\1\120\1\117\1\123\1\124\1\14\1\125\1\126" + + "\2\14\1\56\1\36\1\14\1\60\1\61\1\127\1\63" + + "\1\64\1\65\1\66\1\130\3\14\5\117\1\14\2\32" + + "\1\33\1\25\14\14\1\131\7\14\1\132\13\14\1\133" + + "\1\134\1\135\1\36\1\14\1\136\1\137\1\103\1\140" + + "\1\141\1\142\1\143\1\144\1\145\1\146\1\147\5\14" + + "\1\150\1\151\1\32\1\33\1\25\34\150\1\152\1\150" + + "\1\153\1\154\1\155\1\150\1\56\1\36\21\150\1\14" + + "\2\32\1\33\66\14\74\0\1\15\73\0\1\17\71\0" + + "\1\156\14\20\1\157\1\0\1\160\1\161\4\20\1\0" + + "\6\20\25\0\5\20\5\0\1\162\1\0\5\162\1\0" + + "\4\162\4\0\4\162\2\0\3\162\1\0\1\162\25\0" + + "\5\162\1\22\3\0\66\22\2\0\1\23\73\0\1\25" + + "\72\0\1\26\1\27\4\26\2\27\4\26\1\0\1\163" + + "\1\160\1\164\4\26\1\0\1\27\3\26\1\27\1\26" + + "\25\0\5\26\5\0\14\27\2\0\1\160\1\164\4\27" + + "\1\0\6\27\25\0\5\27\5\0\1\165\1\0\5\165" + + "\1\0\4\165\4\0\4\165\2\0\3\165\1\0\1\165" + + "\25\0\5\165\1\31\3\0\66\31\2\0\1\32\74\0" + + "\1\34\1\35\4\34\2\35\4\34\1\0\1\163\2\0" + + "\4\34\1\0\1\35\3\34\1\35\1\34\25\0\5\34" + + "\5\0\14\35\4\0\4\35\1\0\6\35\25\0\5\35" + + "\1\36\3\0\66\36\4\0\1\37\112\0\2\166\1\167" + + "\1\170\46\0\1\46\1\171\12\46\3\0\5\46\1\0" + + "\1\171\5\46\25\0\5\46\6\0\1\42\23\0\1\42" + + "\3\0\1\42\40\0\3\46\1\171\10\46\3\0\5\46" + + "\1\0\6\46\25\0\2\46\1\172\2\46\5\0\14\46" + + "\3\0\5\46\1\0\6\46\25\0\2\173\3\46\5\0" + + "\1\46\1\174\12\46\3\0\5\46\1\0\1\174\5\46" + + "\25\0\5\46\5\0\14\46\3\0\5\46\1\0\6\46" + + "\25\0\5\46\5\0\2\46\1\175\11\46\3\0\1\46" + + "\1\175\3\46\1\0\6\46\25\0\5\46\6\0\1\176" + + "\17\0\1\176\3\0\6\176\26\0\1\176\35\0\1\177" + + "\45\0\1\200\23\0\1\200\37\0\41\201\1\202\1\203" + + "\27\201\42\204\1\205\1\202\26\204\42\206\1\207\1\206" + + "\1\202\25\206\5\0\14\46\3\0\5\46\1\0\6\46" + + "\25\0\2\210\3\46\5\0\14\46\3\0\2\46\1\211" + + "\2\46\1\0\6\46\25\0\4\46\1\211\5\0\14\72" + + "\3\0\5\72\1\0\6\72\25\0\5\72\21\0\1\212" + + "\55\0\14\72\3\0\1\72\2\213\1\214\1\215\1\0" + + "\6\72\25\0\5\72\21\0\1\216\23\0\1\217\1\220" + + "\44\0\1\221\24\0\1\222\44\0\1\220\132\0\1\223" + + "\72\0\1\224\72\0\1\75\22\0\1\225\21\0\1\225" + + "\50\0\1\226\60\0\14\117\3\0\5\117\1\0\6\117" + + "\25\0\5\117\6\0\1\120\23\0\1\120\3\0\1\120" + + "\41\0\1\227\17\0\1\227\3\0\6\227\26\0\1\227" + + "\35\0\1\230\45\0\1\231\23\0\1\231\37\0\41\232" + + "\1\233\1\234\27\232\42\235\1\236\1\233\26\235\42\237" + + "\1\240\1\237\1\233\25\237\21\0\1\241\71\0\1\242" + + "\23\0\1\243\1\244\44\0\1\245\24\0\1\246\44\0" + + "\1\244\132\0\1\247\72\0\1\250\72\0\1\132\5\0" + + "\2\150\3\0\42\150\2\0\21\150\2\152\3\251\34\152" + + "\1\150\1\252\4\152\2\251\21\152\2\153\3\253\35\153" + + "\1\254\1\150\3\153\2\253\21\153\2\154\3\255\35\154" + + "\1\256\1\154\1\150\2\154\2\255\21\154\2\155\3\257" + + "\35\155\1\260\3\155\1\150\2\257\21\155\4\0\1\156" + + "\2\0\1\261\5\0\1\262\3\0\1\157\3\0\1\261" + + "\11\0\1\262\36\0\1\157\110\0\1\263\71\0\1\264" + + "\53\0\14\162\2\0\1\264\1\0\4\162\1\0\6\162" + + "\25\0\5\162\1\265\3\0\66\265\5\0\14\165\2\0" + + "\1\264\1\0\4\165\1\0\6\165\25\0\5\165\5\0" + + "\3\46\1\266\10\46\3\0\5\46\1\0\6\46\25\0" + + "\5\46\1\201\3\0\66\201\1\204\3\0\66\204\1\206" + + "\3\0\66\206\5\0\14\46\3\0\5\46\1\0\6\46" + + "\25\0\2\46\1\267\2\46\5\0\14\46\3\0\5\46" + + "\1\0\6\46\25\0\2\46\1\270\2\46\20\0\1\271" + + "\70\0\1\271\52\0\1\232\3\0\66\232\1\235\3\0" + + "\66\235\1\237\3\0\66\237\41\251\1\272\1\273\27\251" + + "\1\152\1\150\2\0\1\251\42\152\2\251\21\152\42\253" + + "\1\274\1\272\26\253\1\153\1\150\2\0\1\253\42\153" + + "\2\253\21\153\42\255\1\275\1\255\1\272\25\255\1\154" + + "\1\150\2\0\1\255\42\154\2\255\21\154\42\257\1\276" + + "\3\257\1\272\23\257\1\155\1\150\2\0\1\257\42\155" + + "\2\257\21\155\15\0\1\277\21\0\1\277\50\0\1\300" + + "\53\0\1\251\3\0\66\251\1\253\3\0\66\253\1\255" + + "\3\0\66\255\1\257\3\0\66\257\20\0\1\301\70\0" + + "\1\301\52\0"; private static int[] zzUnpackTrans() { - int[] result = new int[5858]; + int[] result = new int[6322]; int offset = 0; offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); return result; @@ -412,15 +426,16 @@ public class _M68kLexer implements FlexLexer { private static final int[] ZZ_ATTRIBUTE = zzUnpackAttribute(); private static final String ZZ_ATTRIBUTE_PACKED_0 = - "\12\0\2\11\5\1\1\11\6\1\1\11\27\1\5\11" + - "\1\1\4\11\7\1\1\11\10\1\3\11\1\1\1\11" + - "\2\1\3\11\1\1\4\11\11\1\1\0\4\1\3\0" + - "\3\11\5\1\1\11\6\1\1\0\1\11\5\0\10\11" + - "\2\1\2\0\3\1\1\0\1\11\5\0\10\11\3\1" + - "\1\0\1\1\2\0\3\11\3\1\1\11\4\0"; + "\13\0\2\11\5\1\1\11\6\1\1\11\23\1\12\11" + + "\5\1\1\11\2\1\4\11\1\1\4\11\5\1\1\11" + + "\10\1\2\11\1\1\1\11\2\1\3\11\1\1\4\11" + + "\11\1\1\0\4\1\3\0\3\11\10\1\1\0\1\11" + + "\5\0\2\1\1\11\3\1\7\11\2\0\3\1\1\0" + + "\1\11\5\0\10\11\1\0\1\1\1\0\1\1\1\0" + + "\1\1\1\0\1\1\2\0\3\11\3\1\2\11\7\0"; private static int[] zzUnpackAttribute() { - int[] result = new int[176]; + int[] result = new int[193]; int offset = 0; offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); return result; @@ -743,40 +758,40 @@ public class _M68kLexer implements FlexLexer { return BAD_CHARACTER; } // fall through - case 87: + case 96: break; case 2: { return WHITE_SPACE; } // fall through - case 88: + case 97: break; case 3: { yybegin(NOSOL); return WHITE_SPACE; } // fall through - case 89: + case 98: break; case 4: { yybegin(INSTRPART); return GLOBAL_LABEL_DEF; } // fall through - case 90: + case 99: break; case 5: { return COMMENT; } // fall through - case 91: + case 100: break; case 6: { yybegin(YYINITIAL); return WHITE_SPACE; } // fall through - case 92: + case 101: break; case 7: { if (isAsmMnemonicWithSize(yytext())) { @@ -800,520 +815,610 @@ public class _M68kLexer implements FlexLexer { return MACRO_INVOKATION; } // fall through - case 93: + case 102: break; case 8: { yybegin(MACROCALL); return MACRO_INVOKATION; } // fall through - case 94: + case 103: break; case 9: { yybegin(YYINITIAL); return COMMENT; } // fall through - case 95: + case 104: break; case 10: { yybegin(YYINITIAL); return EOL; } // fall through - case 96: + case 105: break; case 11: { yybegin(WAITEOL); return COMMENT; } // fall through - case 97: + case 106: break; case 12: { yybegin(ASMOPS); return WHITE_SPACE; } // fall through - case 98: - break; - case 13: { - return SYMBOL; - } - // fall through - case 99: - break; - case 14: { - return DECIMAL; - } - // fall through - case 100: - break; - case 15: { - return OP_ASSIGN; - } - // fall through - case 101: - break; - case 16: { - return OP_AR_MOD; - } - // fall through - case 102: - break; - case 17: { - return OP_CMP_LT; - } - // fall through - case 103: - break; - case 18: { - return OP_CMP_GT; - } - // fall through - case 104: - break; - case 19: { - return SEPARATOR; - } - // fall through - case 105: - break; - case 20: { - return HASH; - } - // fall through - case 106: - break; - case 21: { - return OP_BITWISE_XOR; - } - // fall through case 107: break; - case 22: { - return ROUND_L; + case 13: { + yybegin(ASMOPS_OP); + return SYMBOL; } // fall through case 108: break; - case 23: { - return ROUND_R; + case 14: { + yybegin(ASMOPS_OP); + return DECIMAL; } // fall through case 109: break; - case 24: { - return OP_UNARY_NOT; + case 15: { + return SEPARATOR; } // fall through case 110: break; - case 25: { - return OP_UNARY_COMPL; + case 16: { + return HASH; } // fall through case 111: break; - case 26: { - return OP_PLUS; + case 17: { + return OP_BITWISE_XOR; } // fall through case 112: break; - case 27: { - return OP_MINUS; + case 18: { + return ROUND_L; } // fall through case 113: break; - case 28: { - return OP_AR_MUL; + case 19: { + yybegin(ASMOPS_OP); + return ROUND_R; } // fall through case 114: break; - case 29: { - return OP_BITWISE_AND; + case 20: { + return OP_UNARY_NOT; } // fall through case 115: break; - case 30: { - return OP_BITWISE_OR; + case 21: { + return OP_UNARY_COMPL; } // fall through case 116: break; - case 31: { - return OP_AR_DIV; + case 22: { + return OP_PLUS; } // fall through case 117: break; - case 32: { - yybegin(EXPR); - return OP_ASSIGN; + case 23: { + return OP_MINUS; } // fall through case 118: break; - case 33: { - yybegin(EXPR_OP); - return SYMBOL; + case 24: { + yybegin(ASMOPS_OP); + return CURRENT_PC_SYMBOL; } // fall through case 119: break; - case 34: { - yybegin(EXPR_OP); - return DECIMAL; + case 25: { + return SYMBOL; } // fall through case 120: break; - case 35: { - yybegin(EXPR_OP); - return ROUND_R; + case 26: { + yybegin(ASMOPS); + return OP_AR_MOD; } // fall through case 121: break; - case 36: { - yybegin(EXPR_OP); - return CURRENT_PC_SYMBOL; + case 27: { + yybegin(ASMOPS); + return OP_CMP_LT; } // fall through case 122: break; - case 37: { - yybegin(EXPR); - return OP_AR_MOD; + case 28: { + yybegin(ASMOPS); + return OP_CMP_GT; } // fall through case 123: break; - case 38: { - yybegin(EXPR); - return OP_CMP_LT; + case 29: { + yybegin(ASMOPS); + return SEPARATOR; } // fall through case 124: break; - case 39: { - yybegin(EXPR); - return OP_CMP_GT; + case 30: { + yybegin(ASMOPS); + return OP_BITWISE_XOR; } // fall through case 125: break; - case 40: { - yybegin(EXPR); - return SEPARATOR; + case 31: { + yybegin(ASMOPS); + return ROUND_L; } // fall through case 126: break; - case 41: { - yybegin(EXPR); - return OP_BITWISE_XOR; + case 32: { + return ROUND_R; } // fall through case 127: break; - case 42: { - yybegin(EXPR); - return ROUND_L; + case 33: { + yybegin(ASMOPS); + return OP_BITWISE_OR; } // fall through case 128: break; - case 43: { - yybegin(EXPR); - return OP_BITWISE_OR; + case 34: { + yybegin(ASMOPS); + return OP_UNARY_COMPL; } // fall through case 129: break; - case 44: { - yybegin(EXPR); - return OP_UNARY_COMPL; + case 35: { + yybegin(ASMOPS); + return OP_PLUS; } // fall through case 130: break; - case 45: { - yybegin(EXPR); - return OP_PLUS; + case 36: { + yybegin(ASMOPS); + return OP_MINUS; } // fall through case 131: break; - case 46: { - yybegin(EXPR); - return OP_MINUS; + case 37: { + yybegin(ASMOPS); + return OP_AR_MUL; } // fall through case 132: break; - case 47: { - yybegin(EXPR); - return OP_AR_MUL; + case 38: { + yybegin(ASMOPS); + return OP_BITWISE_AND; } // fall through case 133: break; - case 48: { - yybegin(EXPR); - return OP_BITWISE_AND; + case 39: { + yybegin(ASMOPS); + return OP_AR_DIV; } // fall through case 134: break; - case 49: { + case 40: { yybegin(EXPR); - return OP_AR_DIV; + return OP_ASSIGN; } // fall through case 135: break; - case 50: { - return STRINGLIT; + case 41: { + yybegin(EXPR_OP); + return SYMBOL; } // fall through case 136: break; + case 42: { + yybegin(EXPR_OP); + return DECIMAL; + } + // fall through + case 137: + break; + case 43: { + yybegin(EXPR_OP); + return ROUND_R; + } + // fall through + case 138: + break; + case 44: { + yybegin(EXPR_OP); + return CURRENT_PC_SYMBOL; + } + // fall through + case 139: + break; + case 45: { + yybegin(EXPR); + return OP_AR_MOD; + } + // fall through + case 140: + break; + case 46: { + yybegin(EXPR); + return OP_CMP_LT; + } + // fall through + case 141: + break; + case 47: { + yybegin(EXPR); + return OP_CMP_GT; + } + // fall through + case 142: + break; + case 48: { + yybegin(EXPR); + return SEPARATOR; + } + // fall through + case 143: + break; + case 49: { + yybegin(EXPR); + return OP_BITWISE_XOR; + } + // fall through + case 144: + break; + case 50: { + yybegin(EXPR); + return ROUND_L; + } + // fall through + case 145: + break; case 51: { + yybegin(EXPR); + return OP_BITWISE_OR; + } + // fall through + case 146: + break; + case 52: { + yybegin(EXPR); + return OP_UNARY_COMPL; + } + // fall through + case 147: + break; + case 53: { + yybegin(EXPR); + return OP_PLUS; + } + // fall through + case 148: + break; + case 54: { + yybegin(EXPR); + return OP_MINUS; + } + // fall through + case 149: + break; + case 55: { + yybegin(EXPR); + return OP_AR_MUL; + } + // fall through + case 150: + break; + case 56: { + yybegin(EXPR); + return OP_BITWISE_AND; + } + // fall through + case 151: + break; + case 57: { + yybegin(EXPR); + return OP_AR_DIV; + } + // fall through + case 152: + break; + case 58: { + return STRINGLIT; + } + // fall through + case 153: + break; + case 59: { yybegin(ASSIGNMENT); yypushback(pushbackAssignment(yytext())); return SYMBOLDEF; } // fall through - case 137: + case 154: break; - case 52: { + case 60: { yybegin(INSTRPART); return LOCAL_LABEL_DEF; } // fall through - case 138: - break; - case 53: { - return OPSIZE_BS; - } - // fall through - case 139: - break; - case 54: { - return OPSIZE_W; - } - // fall through - case 140: - break; - case 55: { - return OPSIZE_L; - } - // fall through - case 141: - break; - case 56: { - return AREG; - } - // fall through - case 142: - break; - case 57: { - return REG_SR; - } - // fall through - case 143: - break; - case 58: { - return PC; - } - // fall through - case 144: - break; - case 59: { - return DREG; - } - // fall through - case 145: - break; - case 60: { - return OP_CMP_EQ; - } - // fall through - case 146: - break; - case 61: { - return HEXADECIMAL; - } - // fall through - case 147: - break; - case 62: { - return BINARY; - } - // fall through - case 148: - break; - case 63: { - return OCTAL; - } - // fall through - case 149: - break; - case 64: { - return OP_CMP_LT_EQ; - } - // fall through - case 150: - break; - case 65: { - return OP_AR_SHIFT_L; - } - // fall through - case 151: - break; - case 66: { - return OP_CMP_NOT_EQ; - } - // fall through - case 152: - break; - case 67: { - return OP_CMP_GT_EQ; - } - // fall through - case 153: - break; - case 68: { - return OP_AR_SHIFT_R; - } - // fall through - case 154: - break; - case 69: { - return OP_LOGICAL_AND; - } - // fall through case 155: break; - case 70: { - return OP_LOGICAL_OR; + case 61: { + return OPSIZE_BS; } // fall through case 156: break; - case 71: { - yybegin(EXPR_OP); - return HEXADECIMAL; + case 62: { + return OPSIZE_W; } // fall through case 157: break; - case 72: { - yybegin(EXPR_OP); - return BINARY; + case 63: { + return OPSIZE_L; } // fall through case 158: break; - case 73: { - yybegin(EXPR_OP); - return OCTAL; + case 64: { + yybegin(ASMOPS_OP); + return AREG; } // fall through case 159: break; - case 74: { - yybegin(EXPR_OP); - return STRINGLIT; + case 65: { + yybegin(ASMOPS_OP); + return REG_SR; } // fall through case 160: break; - case 75: { - yybegin(EXPR); - return OP_CMP_EQ; + case 66: { + yybegin(ASMOPS_OP); + return PC; } // fall through case 161: break; - case 76: { - yybegin(EXPR); - return OP_CMP_LT_EQ; + case 67: { + yybegin(ASMOPS_OP); + return DREG; } // fall through case 162: break; - case 77: { - yybegin(EXPR); - return OP_AR_SHIFT_L; + case 68: { + yybegin(ASMOPS_OP); + return HEXADECIMAL; } // fall through case 163: break; - case 78: { - yybegin(EXPR); - return OP_CMP_NOT_EQ; + case 69: { + yybegin(ASMOPS_OP); + return BINARY; } // fall through case 164: break; - case 79: { - yybegin(EXPR); - return OP_CMP_GT_EQ; + case 70: { + yybegin(ASMOPS_OP); + return OCTAL; } // fall through case 165: break; - case 80: { - yybegin(EXPR); - return OP_AR_SHIFT_R; + case 71: { + yybegin(ASMOPS_OP); + return STRINGLIT; } // fall through case 166: break; - case 81: { - yybegin(EXPR); - return OP_LOGICAL_AND; + case 72: { + yybegin(ASMOPS); + return OP_CMP_EQ; } // fall through case 167: break; - case 82: { - yybegin(EXPR); - return OP_LOGICAL_OR; + case 73: { + yybegin(ASMOPS); + return OP_CMP_LT_EQ; } // fall through case 168: break; - case 83: { - return REG_USP; + case 74: { + yybegin(ASMOPS); + return OP_AR_SHIFT_L; } // fall through case 169: break; - case 84: { - return REG_CCR; + case 75: { + yybegin(ASMOPS); + return OP_CMP_NOT_EQ; } // fall through case 170: break; - case 85: { - return REG_VBR; + case 76: { + yybegin(ASMOPS); + return OP_CMP_GT_EQ; } // fall through case 171: break; + case 77: { + yybegin(ASMOPS); + return OP_AR_SHIFT_R; + } + // fall through + case 172: + break; + case 78: { + yybegin(ASMOPS); + return OP_LOGICAL_AND; + } + // fall through + case 173: + break; + case 79: { + yybegin(ASMOPS); + return OP_LOGICAL_OR; + } + // fall through + case 174: + break; + case 80: { + yybegin(EXPR_OP); + return HEXADECIMAL; + } + // fall through + case 175: + break; + case 81: { + yybegin(EXPR_OP); + return BINARY; + } + // fall through + case 176: + break; + case 82: { + yybegin(EXPR_OP); + return OCTAL; + } + // fall through + case 177: + break; + case 83: { + yybegin(EXPR_OP); + return STRINGLIT; + } + // fall through + case 178: + break; + case 84: { + yybegin(EXPR); + return OP_CMP_EQ; + } + // fall through + case 179: + break; + case 85: { + yybegin(EXPR); + return OP_CMP_LT_EQ; + } + // fall through + case 180: + break; case 86: { + yybegin(EXPR); + return OP_AR_SHIFT_L; + } + // fall through + case 181: + break; + case 87: { + yybegin(EXPR); + return OP_CMP_NOT_EQ; + } + // fall through + case 182: + break; + case 88: { + yybegin(EXPR); + return OP_CMP_GT_EQ; + } + // fall through + case 183: + break; + case 89: { + yybegin(EXPR); + return OP_AR_SHIFT_R; + } + // fall through + case 184: + break; + case 90: { + yybegin(EXPR); + return OP_LOGICAL_AND; + } + // fall through + case 185: + break; + case 91: { + yybegin(EXPR); + return OP_LOGICAL_OR; + } + // fall through + case 186: + break; + case 92: { + yybegin(ASMOPS_OP); + return REG_USP; + } + // fall through + case 187: + break; + case 93: { + yybegin(ASMOPS_OP); + return REG_CCR; + } + // fall through + case 188: + break; + case 94: { + yybegin(ASMOPS_OP); + return REG_VBR; + } + // fall through + case 189: + break; + case 95: { yybegin(EXPR); return EQU; } // fall through - case 172: + case 190: break; default: zzScanError(ZZ_NO_MATCH); diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/asm/AssemblerDirectives.kt b/src/main/java/de/platon42/intellij/plugins/m68k/asm/AssemblerDirectives.kt index d6fb1f6..e649d45 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/asm/AssemblerDirectives.kt +++ b/src/main/java/de/platon42/intellij/plugins/m68k/asm/AssemblerDirectives.kt @@ -33,6 +33,8 @@ object AssemblerDirectives { "extern", "nref", "xdef", "xref", "globl", "public", "weak", + "reg", "equr", "equrl", + "incdir", "include", "incbin", "output", "list", "nlist", "nolist", "llen", "nopage", "page", "spc", diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/lexer/_M68kLexer.flex b/src/main/java/de/platon42/intellij/plugins/m68k/lexer/_M68kLexer.flex index 67f32b4..23a90a0 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/lexer/_M68kLexer.flex +++ b/src/main/java/de/platon42/intellij/plugins/m68k/lexer/_M68kLexer.flex @@ -49,7 +49,7 @@ PLAINPARAM=(`([^`\\]|\\.)*`|'([^'\\]|\\.)*'|\"([^\"\\]|\\.)*\")|<([^>\\]|\\.)*>| COMMENT=([;].*+) HASH_COMMENT=([#;*].*+) -%state NOSOL,INSTRPART,ASMINSTR,ASMOPS,ASSIGNMENT,EXPR,EXPR_OP,MACROCALL,WAITEOL +%state NOSOL,INSTRPART,ASMINSTR,ASMOPS,ASMOPS_OP,ASSIGNMENT,EXPR,EXPR_OP,MACROCALL,WAITEOL %% { @@ -158,21 +158,14 @@ HASH_COMMENT=([#;*].*+) {WHITE_SPACE} { return WHITE_SPACE; } // FIXME space optionally introduces comment {EOL} { yybegin(YYINITIAL); return EOL; } -// {BINARY} { return BINARY; } -// {HEXADECIMAL} { return HEXADECIMAL; } -// {OCTAL} { return OCTAL; } -// {DECIMAL} { return DECIMAL; } -// {STRINGLIT} { return STRINGLIT; } - "<<" { yybegin(EXPR); return OP_AR_SHIFT_L; } ">>" { yybegin(EXPR); return OP_AR_SHIFT_R; } "&&" { yybegin(EXPR); return OP_LOGICAL_AND; } "||" { yybegin(EXPR); return OP_LOGICAL_OR; } "==" { yybegin(EXPR); return OP_CMP_EQ; } - "<>" { yybegin(EXPR); return OP_CMP_NOT_EQ; } + "<>"|"!=" { yybegin(EXPR); return OP_CMP_NOT_EQ; } ">=" { yybegin(EXPR); return OP_CMP_GT_EQ; } "<=" { yybegin(EXPR); return OP_CMP_LT_EQ; } - "!=" { yybegin(EXPR); return OP_CMP_NOT_EQ; } "<" { yybegin(EXPR); return OP_CMP_LT; } ">" { yybegin(EXPR); return OP_CMP_GT; } "&" { yybegin(EXPR); return OP_BITWISE_AND; } @@ -187,7 +180,7 @@ HASH_COMMENT=([#;*].*+) ")" { return ROUND_R; } // "." { return DOT; } // "$" { return DOLLAR; } - "=" { yybegin(EXPR); return OP_ASSIGN; } +// "=" { yybegin(EXPR); return OP_ASSIGN; } "~" { yybegin(EXPR); return OP_UNARY_COMPL; } "+" { yybegin(EXPR); return OP_PLUS; } "-" { yybegin(EXPR); return OP_MINUS; } @@ -195,8 +188,6 @@ HASH_COMMENT=([#;*].*+) "%"|"//" { yybegin(EXPR); return OP_AR_MOD; } "/" { yybegin(EXPR); return OP_AR_DIV; } -// {SYMBOL} { return SYMBOL; } - {COMMENT} { yybegin(WAITEOL); return COMMENT; } } @@ -204,61 +195,78 @@ HASH_COMMENT=([#;*].*+) {WHITE_SPACE} { return WHITE_SPACE; } // FIXME space optionally introduces comment {EOL} { yybegin(YYINITIAL); return EOL; } - {BINARY} { return BINARY; } - {HEXADECIMAL} { return HEXADECIMAL; } - {OCTAL} { return OCTAL; } - {DECIMAL} { return DECIMAL; } - {STRINGLIT} { return STRINGLIT; } + {BINARY} { yybegin(ASMOPS_OP); return BINARY; } + {HEXADECIMAL} { yybegin(ASMOPS_OP); return HEXADECIMAL; } + {OCTAL} { yybegin(ASMOPS_OP); return OCTAL; } + {DECIMAL} { yybegin(ASMOPS_OP); return DECIMAL; } + {STRINGLIT} { yybegin(ASMOPS_OP); return STRINGLIT; } + + {AREG} { yybegin(ASMOPS_OP); return AREG; } + {DREG} { yybegin(ASMOPS_OP); return DREG; } + "pc" { yybegin(ASMOPS_OP); return PC; } + "ccr" { yybegin(ASMOPS_OP); return REG_CCR; } + "sr" { yybegin(ASMOPS_OP); return REG_SR; } + "usp" { yybegin(ASMOPS_OP); return REG_USP; } + "vbr" { yybegin(ASMOPS_OP); return REG_VBR; } + + "^" { return OP_BITWISE_XOR; } + "," { return SEPARATOR; } + "(" { return ROUND_L; } + ")" { yybegin(ASMOPS_OP); return ROUND_R; } + "!" { return OP_UNARY_NOT; } + "~" { return OP_UNARY_COMPL; } + "+" { return OP_PLUS; } + "-" { return OP_MINUS; } + "*" { yybegin(ASMOPS_OP); return CURRENT_PC_SYMBOL; } + + "#" { return HASH; } + + {SYMBOL} { yybegin(ASMOPS_OP); return SYMBOL; } + + {COMMENT} { yybegin(WAITEOL); return COMMENT; } +} + + { + {WHITE_SPACE} { return WHITE_SPACE; } // FIXME space optionally introduces comment + {EOL} { yybegin(YYINITIAL); return EOL; } {OPSIZE_BS} { return OPSIZE_BS; } {OPSIZE_W} { return OPSIZE_W; } {OPSIZE_L} { return OPSIZE_L; } - {AREG} { return AREG; } - {DREG} { return DREG; } - "pc" { return PC; } - "ccr" { return REG_CCR; } - "sr" { return REG_SR; } - "usp" { return REG_USP; } - "vbr" { return REG_VBR; } - - "<<" { return OP_AR_SHIFT_L; } - ">>" { return OP_AR_SHIFT_R; } - "&&" { return OP_LOGICAL_AND; } - "||" { return OP_LOGICAL_OR; } - "==" { return OP_CMP_EQ; } - "<>" { return OP_CMP_NOT_EQ; } - ">=" { return OP_CMP_GT_EQ; } - "<=" { return OP_CMP_LT_EQ; } - "!=" { return OP_CMP_NOT_EQ; } - "<" { return OP_CMP_LT; } - ">" { return OP_CMP_GT; } - "&" { return OP_BITWISE_AND; } - "|" { return OP_BITWISE_OR; } - "^" { return OP_BITWISE_XOR; } + "<<" { yybegin(ASMOPS); return OP_AR_SHIFT_L; } + ">>" { yybegin(ASMOPS); return OP_AR_SHIFT_R; } + "&&" { yybegin(ASMOPS); return OP_LOGICAL_AND; } + "||" { yybegin(ASMOPS); return OP_LOGICAL_OR; } + "==" { yybegin(ASMOPS); return OP_CMP_EQ; } + "<>"|"!=" { yybegin(ASMOPS); return OP_CMP_NOT_EQ; } + ">=" { yybegin(ASMOPS); return OP_CMP_GT_EQ; } + "<=" { yybegin(ASMOPS); return OP_CMP_LT_EQ; } + "<" { yybegin(ASMOPS); return OP_CMP_LT; } + ">" { yybegin(ASMOPS); return OP_CMP_GT; } + "&" { yybegin(ASMOPS); return OP_BITWISE_AND; } + "|"|"!" { yybegin(ASMOPS); return OP_BITWISE_OR; } + "^" { yybegin(ASMOPS); return OP_BITWISE_XOR; } // ":" { return COLON; } // ";" { return SEMICOLON; } // "[" { return SQUARE_L; } // "]" { return SQUARE_R; } - "(" { return ROUND_L; } + "," { yybegin(ASMOPS); return SEPARATOR; } + "(" { yybegin(ASMOPS); return ROUND_L; } ")" { return ROUND_R; } - "," { return SEPARATOR; } // "." { return DOT; } - "#" { return HASH; } // "$" { return DOLLAR; } - "=" { return OP_ASSIGN; } - "!" { return OP_UNARY_NOT; } - "~" { return OP_UNARY_COMPL; } - "+" { return OP_PLUS; } - "-" { return OP_MINUS; } - "*" { return OP_AR_MUL; } - "%"|"//" { return OP_AR_MOD; } - "/" { return OP_AR_DIV; } +// "=" { return OP_ASSIGN; } + "~" { yybegin(ASMOPS); return OP_UNARY_COMPL; } + "+" { yybegin(ASMOPS); return OP_PLUS; } + "-" { yybegin(ASMOPS); return OP_MINUS; } + "*" { yybegin(ASMOPS); return OP_AR_MUL; } + "%"|"//" { yybegin(ASMOPS); return OP_AR_MOD; } + "/" { yybegin(ASMOPS); return OP_AR_DIV; } {SYMBOL} { return SYMBOL; } {COMMENT} { yybegin(WAITEOL); return COMMENT; } - } diff --git a/src/test/java/de/platon42/intellij/plugins/m68k/parser/AddressingModesTest.kt b/src/test/java/de/platon42/intellij/plugins/m68k/parser/AddressingModesTest.kt index 2ca32b2..7ff7bef 100644 --- a/src/test/java/de/platon42/intellij/plugins/m68k/parser/AddressingModesTest.kt +++ b/src/test/java/de/platon42/intellij/plugins/m68k/parser/AddressingModesTest.kt @@ -98,4 +98,9 @@ internal class AddressingModesTest : AbstractParsingTest() { testGoodSyntax(testCase, " move.l usp,a0\n" + " move.l a5,usp\n") } + + @Test + internal fun complex_math_expression_in_displacement(@MyTestCase testCase: ParsingTestExtension.IParsingTestCase) { + testGoodSyntax(testCase, " move.l -(~(!!(+(1//~WIDTH^@123+3*4/2+(NARF%10|32!21))<<2)>>1)&$1f)(a0),(-(~(!!(+(1//~WIDTH^@123+3*4/2+(NARF%10|32!21))<<2)>>1)&\$1f),a0,d0.l)\n") + } } \ No newline at end of file diff --git a/src/test/resources/parser/addressingmodes/complex_math_expression_in_displacement.txt b/src/test/resources/parser/addressingmodes/complex_math_expression_in_displacement.txt new file mode 100644 index 0000000..1941f77 --- /dev/null +++ b/src/test/resources/parser/addressingmodes/complex_math_expression_in_displacement.txt @@ -0,0 +1,181 @@ +Assembly File: a.asm + PsiWhiteSpace(' ') + M68kStatementImpl(STATEMENT) + M68kAsmInstructionImpl(ASM_INSTRUCTION) + M68kAsmOpImpl(ASM_OP) + PsiElement(M68kTokenType.MNEMONIC)('move') + M68kOperandSizeImpl(OPERAND_SIZE) + PsiElement(M68kTokenType.OPSIZE_L)('.l') + PsiWhiteSpace(' ') + M68kAddressRegisterIndirectWithDisplacementOldAddressingModeImpl(ADDRESS_REGISTER_INDIRECT_WITH_DISPLACEMENT_OLD_ADDRESSING_MODE) + M68kUnaryMinusExprImpl(UNARY_MINUS_EXPR) + PsiElement(M68kTokenType.OP_MINUS)('-') + M68kParenExprImpl(PAREN_EXPR) + PsiElement(M68kTokenType.ROUND_L)('(') + M68kBinaryBitwiseAndExprImpl(BINARY_BITWISE_AND_EXPR) + M68kUnaryComplExprImpl(UNARY_COMPL_EXPR) + PsiElement(M68kTokenType.OP_UNARY_COMPL)('~') + M68kParenExprImpl(PAREN_EXPR) + PsiElement(M68kTokenType.ROUND_L)('(') + M68kBinaryShiftRExprImpl(BINARY_SHIFT_R_EXPR) + M68kUnaryNotExprImpl(UNARY_NOT_EXPR) + PsiElement(M68kTokenType.OP_UNARY_NOT)('!') + M68kUnaryNotExprImpl(UNARY_NOT_EXPR) + PsiElement(M68kTokenType.OP_UNARY_NOT)('!') + M68kParenExprImpl(PAREN_EXPR) + PsiElement(M68kTokenType.ROUND_L)('(') + M68kBinaryShiftLExprImpl(BINARY_SHIFT_L_EXPR) + M68kUnaryPlusExprImpl(UNARY_PLUS_EXPR) + PsiElement(M68kTokenType.OP_PLUS)('+') + M68kParenExprImpl(PAREN_EXPR) + PsiElement(M68kTokenType.ROUND_L)('(') + M68kBinaryAddExprImpl(BINARY_ADD_EXPR) + M68kBinaryAddExprImpl(BINARY_ADD_EXPR) + M68kBinaryModExprImpl(BINARY_MOD_EXPR) + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('1') + PsiElement(M68kTokenType.OP_AR_MOD)('//') + M68kBinaryBitwiseXorExprImpl(BINARY_BITWISE_XOR_EXPR) + M68kUnaryComplExprImpl(UNARY_COMPL_EXPR) + PsiElement(M68kTokenType.OP_UNARY_COMPL)('~') + M68kRefExprImpl(REF_EXPR) + PsiElement(M68kTokenType.SYMBOL)('WIDTH') + PsiElement(M68kTokenType.OP_BITWISE_XOR)('^') + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.OCTAL)('@123') + PsiElement(M68kTokenType.OP_PLUS)('+') + M68kBinaryDivExprImpl(BINARY_DIV_EXPR) + M68kBinaryMulExprImpl(BINARY_MUL_EXPR) + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('3') + PsiElement(M68kTokenType.OP_AR_MUL)('*') + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('4') + PsiElement(M68kTokenType.OP_AR_DIV)('/') + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('2') + PsiElement(M68kTokenType.OP_PLUS)('+') + M68kParenExprImpl(PAREN_EXPR) + PsiElement(M68kTokenType.ROUND_L)('(') + M68kBinaryModExprImpl(BINARY_MOD_EXPR) + M68kRefExprImpl(REF_EXPR) + PsiElement(M68kTokenType.SYMBOL)('NARF') + PsiElement(M68kTokenType.OP_AR_MOD)('%') + M68kBinaryBitwiseOrExprImpl(BINARY_BITWISE_OR_EXPR) + M68kBinaryBitwiseOrExprImpl(BINARY_BITWISE_OR_EXPR) + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('10') + PsiElement(M68kTokenType.OP_BITWISE_OR)('|') + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('32') + PsiElement(M68kTokenType.OP_BITWISE_OR)('!') + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('21') + PsiElement(M68kTokenType.ROUND_R)(')') + PsiElement(M68kTokenType.ROUND_R)(')') + PsiElement(M68kTokenType.OP_AR_SHIFT_L)('<<') + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('2') + PsiElement(M68kTokenType.ROUND_R)(')') + PsiElement(M68kTokenType.OP_AR_SHIFT_R)('>>') + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('1') + PsiElement(M68kTokenType.ROUND_R)(')') + PsiElement(M68kTokenType.OP_BITWISE_AND)('&') + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.HEXADECIMAL)('$1f') + PsiElement(M68kTokenType.ROUND_R)(')') + PsiElement(M68kTokenType.ROUND_L)('(') + M68kAddressRegisterImpl(ADDRESS_REGISTER) + PsiElement(M68kTokenType.AREG)('a0') + PsiElement(M68kTokenType.ROUND_R)(')') + PsiElement(M68kTokenType.SEPARATOR)(',') + M68kAddressRegisterIndirectWithIndexNewAddressingModeImpl(ADDRESS_REGISTER_INDIRECT_WITH_INDEX_NEW_ADDRESSING_MODE) + PsiElement(M68kTokenType.ROUND_L)('(') + M68kUnaryMinusExprImpl(UNARY_MINUS_EXPR) + PsiElement(M68kTokenType.OP_MINUS)('-') + M68kParenExprImpl(PAREN_EXPR) + PsiElement(M68kTokenType.ROUND_L)('(') + M68kBinaryBitwiseAndExprImpl(BINARY_BITWISE_AND_EXPR) + M68kUnaryComplExprImpl(UNARY_COMPL_EXPR) + PsiElement(M68kTokenType.OP_UNARY_COMPL)('~') + M68kParenExprImpl(PAREN_EXPR) + PsiElement(M68kTokenType.ROUND_L)('(') + M68kBinaryShiftRExprImpl(BINARY_SHIFT_R_EXPR) + M68kUnaryNotExprImpl(UNARY_NOT_EXPR) + PsiElement(M68kTokenType.OP_UNARY_NOT)('!') + M68kUnaryNotExprImpl(UNARY_NOT_EXPR) + PsiElement(M68kTokenType.OP_UNARY_NOT)('!') + M68kParenExprImpl(PAREN_EXPR) + PsiElement(M68kTokenType.ROUND_L)('(') + M68kBinaryShiftLExprImpl(BINARY_SHIFT_L_EXPR) + M68kUnaryPlusExprImpl(UNARY_PLUS_EXPR) + PsiElement(M68kTokenType.OP_PLUS)('+') + M68kParenExprImpl(PAREN_EXPR) + PsiElement(M68kTokenType.ROUND_L)('(') + M68kBinaryAddExprImpl(BINARY_ADD_EXPR) + M68kBinaryAddExprImpl(BINARY_ADD_EXPR) + M68kBinaryModExprImpl(BINARY_MOD_EXPR) + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('1') + PsiElement(M68kTokenType.OP_AR_MOD)('//') + M68kBinaryBitwiseXorExprImpl(BINARY_BITWISE_XOR_EXPR) + M68kUnaryComplExprImpl(UNARY_COMPL_EXPR) + PsiElement(M68kTokenType.OP_UNARY_COMPL)('~') + M68kRefExprImpl(REF_EXPR) + PsiElement(M68kTokenType.SYMBOL)('WIDTH') + PsiElement(M68kTokenType.OP_BITWISE_XOR)('^') + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.OCTAL)('@123') + PsiElement(M68kTokenType.OP_PLUS)('+') + M68kBinaryDivExprImpl(BINARY_DIV_EXPR) + M68kBinaryMulExprImpl(BINARY_MUL_EXPR) + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('3') + PsiElement(M68kTokenType.OP_AR_MUL)('*') + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('4') + PsiElement(M68kTokenType.OP_AR_DIV)('/') + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('2') + PsiElement(M68kTokenType.OP_PLUS)('+') + M68kParenExprImpl(PAREN_EXPR) + PsiElement(M68kTokenType.ROUND_L)('(') + M68kBinaryModExprImpl(BINARY_MOD_EXPR) + M68kRefExprImpl(REF_EXPR) + PsiElement(M68kTokenType.SYMBOL)('NARF') + PsiElement(M68kTokenType.OP_AR_MOD)('%') + M68kBinaryBitwiseOrExprImpl(BINARY_BITWISE_OR_EXPR) + M68kBinaryBitwiseOrExprImpl(BINARY_BITWISE_OR_EXPR) + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('10') + PsiElement(M68kTokenType.OP_BITWISE_OR)('|') + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('32') + PsiElement(M68kTokenType.OP_BITWISE_OR)('!') + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('21') + PsiElement(M68kTokenType.ROUND_R)(')') + PsiElement(M68kTokenType.ROUND_R)(')') + PsiElement(M68kTokenType.OP_AR_SHIFT_L)('<<') + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('2') + PsiElement(M68kTokenType.ROUND_R)(')') + PsiElement(M68kTokenType.OP_AR_SHIFT_R)('>>') + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('1') + PsiElement(M68kTokenType.ROUND_R)(')') + PsiElement(M68kTokenType.OP_BITWISE_AND)('&') + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.HEXADECIMAL)('$1f') + PsiElement(M68kTokenType.ROUND_R)(')') + PsiElement(M68kTokenType.SEPARATOR)(',') + M68kAddressRegisterImpl(ADDRESS_REGISTER) + PsiElement(M68kTokenType.AREG)('a0') + PsiElement(M68kTokenType.SEPARATOR)(',') + M68kDataRegisterImpl(DATA_REGISTER) + PsiElement(M68kTokenType.DREG)('d0') + M68kDataWidthImpl(DATA_WIDTH) + PsiElement(M68kTokenType.OPSIZE_L)('.l') + PsiElement(M68kTokenType.ROUND_R)(')') + PsiElement(M68kTokenType.EOL)('\n') \ No newline at end of file