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 4cfe091..387caea 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 @@ -190,19 +190,19 @@ public class _M68kLexer implements FlexLexer { private static final String ZZ_ACTION_PACKED_0 = "\11\0\1\1\2\2\1\3\1\4\1\1\1\5\2\6" + "\1\2\1\7\2\10\1\11\2\12\1\7\1\13\1\14" + - "\1\15\1\1\1\13\1\16\4\13\1\17\1\13\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\13\2\1\1\40\1\13\1\12\4\13\1\0" + - "\1\41\1\4\2\42\1\0\3\10\1\43\1\44\1\45" + - "\1\46\1\47\1\50\1\13\1\51\1\43\1\44\1\52" + - "\1\53\1\54\1\0\1\55\5\0\1\56\1\57\1\60" + - "\1\61\1\62\1\63\1\64\2\13\3\0\1\13\1\0" + - "\1\13\1\0\1\13\1\0\1\13\2\0\1\4\1\42" + - "\1\7\1\65\1\66\1\67\1\70\1\13\7\0"; + "\1\15\1\1\1\16\1\17\5\16\1\20\1\16\1\1" + + "\1\21\4\1\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" + + "\1\40\2\16\2\1\1\41\1\42\1\12\4\42\1\0" + + "\1\43\1\4\2\44\1\0\3\10\1\45\1\46\1\47" + + "\1\50\1\51\1\52\1\16\1\53\1\45\1\46\1\54" + + "\1\55\1\56\1\0\1\42\5\0\1\57\1\60\1\61" + + "\1\62\1\63\1\64\1\65\2\16\2\0\3\42\1\0" + + "\1\42\2\0\1\4\1\44\1\7\1\66\1\67\1\70" + + "\1\71\4\0"; private static int[] zzUnpackAction() { - int[] result = new int[135]; + int[] result = new int[129]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; @@ -232,21 +232,21 @@ public class _M68kLexer implements FlexLexer { "\0\u0201\0\u0357\0\u0390\0\u03c9\0\u0402\0\u043b\0\u0474\0\u0201" + "\0\u04ad\0\u04e6\0\u051f\0\u0558\0\u0591\0\u05ca\0\u0603\0\u063c" + "\0\u0675\0\u06ae\0\u06e7\0\u0720\0\u0759\0\u0792\0\u07cb\0\u0804" + - "\0\u083d\0\u0876\0\u08af\0\u08e8\0\u0921\0\u095a\0\u0201\0\u0201" + - "\0\u0993\0\u09cc\0\u0a05\0\u0201\0\u0201\0\u0201\0\u0201\0\u0201" + - "\0\u0201\0\u0201\0\u0201\0\u0a3e\0\u0a77\0\u0ab0\0\u0ae9\0\u0201" + - "\0\u0b22\0\u0b22\0\u0b5b\0\u0b94\0\u0bcd\0\u0c06\0\u0c3f\0\u0c78" + - "\0\u0cb1\0\u0cea\0\u0d23\0\u0d5c\0\u0d95\0\u0dce\0\u0e07\0\u0201" + - "\0\u0201\0\u051f\0\u051f\0\u051f\0\u051f\0\u0e40\0\u0201\0\u051f" + - "\0\u051f\0\u07cb\0\u0804\0\u083d\0\u0876\0\u0201\0\u0e79\0\u08af" + - "\0\u0eb2\0\u08e8\0\u0eeb\0\u0201\0\u0201\0\u0201\0\u0201\0\u0201" + - "\0\u0201\0\u0201\0\u0f24\0\u0f5d\0\u0f96\0\u0fcf\0\u1008\0\u1041" + - "\0\u107a\0\u10b3\0\u10ec\0\u1125\0\u115e\0\u1197\0\u11d0\0\u1209" + - "\0\u0201\0\u0201\0\u0201\0\u051f\0\u051f\0\u051f\0\u0201\0\u0201" + - "\0\u1242\0\u127b\0\u12b4\0\u12ed\0\u1326\0\u135f\0\u0c78"; + "\0\u083d\0\u0876\0\u08af\0\u08e8\0\u0921\0\u095a\0\u0993\0\u0201" + + "\0\u0201\0\u09cc\0\u0a05\0\u0a3e\0\u0201\0\u0201\0\u0201\0\u0201" + + "\0\u0201\0\u0201\0\u0201\0\u0201\0\u0a77\0\u0ab0\0\u0ae9\0\u0b22" + + "\0\u0201\0\u0b5b\0\u0b5b\0\u0b94\0\u0bcd\0\u0c06\0\u0c3f\0\u0c78" + + "\0\u0cb1\0\u0cea\0\u0d23\0\u0d5c\0\u0d95\0\u0dce\0\u0e07\0\u0e40" + + "\0\u0201\0\u0201\0\u0720\0\u0720\0\u0720\0\u0720\0\u0e79\0\u0201" + + "\0\u0720\0\u0720\0\u0804\0\u083d\0\u0876\0\u08af\0\u0201\0\u0eb2" + + "\0\u08e8\0\u0eeb\0\u0921\0\u0f24\0\u0201\0\u0201\0\u0201\0\u0201" + + "\0\u0201\0\u0201\0\u0201\0\u0f5d\0\u0f96\0\u0fcf\0\u1008\0\u1041" + + "\0\u107a\0\u10b3\0\u10ec\0\u1125\0\u115e\0\u1197\0\u0201\0\u0201" + + "\0\u0201\0\u0720\0\u0720\0\u0720\0\u0201\0\u11d0\0\u1209\0\u1242" + + "\0\u0cb1"; private static int[] zzUnpackRowMap() { - int[] result = new int[135]; + int[] result = new int[129]; int offset = 0; offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); return result; @@ -279,84 +279,82 @@ public class _M68kLexer implements FlexLexer { "\4\32\1\12\1\33\2\12\3\32\2\12\3\32\1\12" + "\1\32\10\12\1\34\14\12\5\32\1\12\2\30\1\31" + "\1\35\15\12\1\36\24\12\1\34\22\12\2\30\1\31" + - "\1\23\1\37\1\40\1\41\1\42\1\43\2\33\1\12" + - "\2\33\1\44\1\33\1\45\1\46\1\12\1\47\1\41" + - "\2\33\1\50\1\40\1\37\1\43\1\33\1\40\1\33" + - "\1\51\1\52\1\12\1\53\1\54\1\55\1\56\1\57" + - "\1\34\1\60\1\61\1\62\1\63\1\64\1\65\1\66" + - "\1\67\1\70\1\71\1\72\1\73\2\74\1\33\1\75" + - "\1\33\1\12\2\30\1\31\1\23\2\12\1\76\5\12" + - "\1\77\3\12\1\100\3\12\1\76\10\12\1\77\10\12" + - "\1\34\22\12\2\30\1\31\1\23\1\33\1\40\5\33" + - "\1\12\4\33\1\45\1\33\1\12\1\47\3\33\1\50" + - "\1\40\3\33\1\40\1\33\1\51\1\52\1\12\1\53" + - "\1\54\1\55\1\56\1\57\1\34\1\12\1\61\1\62" + - "\1\63\1\64\1\65\1\66\1\67\1\70\1\71\1\72" + - "\1\73\5\33\1\101\1\102\1\30\1\31\1\23\33\101" + - "\1\103\1\101\1\104\1\105\1\106\1\101\1\57\1\34" + - "\21\101\1\12\2\30\1\31\65\12\73\0\1\13\72\0" + - "\1\15\70\0\1\107\14\16\1\110\1\0\1\111\1\112" + - "\3\16\1\0\6\16\25\0\5\16\5\0\1\113\1\0" + - "\5\113\1\0\4\113\4\0\3\113\2\0\3\113\1\0" + - "\1\113\25\0\5\113\1\20\3\0\65\20\2\0\1\21" + + "\1\23\1\37\1\40\1\41\1\42\1\43\2\44\1\12" + + "\2\44\1\45\1\44\1\46\1\47\1\12\1\50\1\41" + + "\2\44\1\51\1\40\1\37\1\43\1\44\1\40\1\44" + + "\1\52\1\53\1\12\1\54\1\55\1\56\1\57\1\60" + + "\1\34\1\61\1\62\1\63\1\64\1\65\1\66\1\67" + + "\1\70\1\71\1\72\1\73\1\74\2\75\1\44\1\76" + + "\1\44\1\12\2\30\1\31\1\23\2\12\1\77\5\12" + + "\1\100\3\12\1\101\3\12\1\77\10\12\1\100\10\12" + + "\1\34\22\12\2\30\1\31\1\23\1\44\1\40\5\44" + + "\1\12\4\44\1\46\1\44\1\12\1\50\3\44\1\51" + + "\1\40\3\44\1\40\1\44\1\52\1\53\1\12\1\54" + + "\1\55\1\56\1\57\1\60\1\34\1\12\1\62\1\63" + + "\1\64\1\65\1\66\1\67\1\70\1\71\1\72\1\73" + + "\1\74\5\44\1\102\1\103\1\30\1\31\1\23\33\102" + + "\1\104\1\102\1\105\1\106\1\107\1\102\1\60\1\34" + + "\21\102\1\12\2\30\1\31\65\12\73\0\1\13\72\0" + + "\1\15\70\0\1\110\14\16\1\111\1\0\1\112\1\113" + + "\3\16\1\0\6\16\25\0\5\16\5\0\1\114\1\0" + + "\5\114\1\0\4\114\4\0\3\114\2\0\3\114\1\0" + + "\1\114\25\0\5\114\1\20\3\0\65\20\2\0\1\21" + "\72\0\1\23\71\0\1\24\1\25\4\24\2\25\4\24" + - "\1\0\1\114\1\111\1\115\3\24\1\0\1\25\3\24" + - "\1\25\1\24\25\0\5\24\5\0\14\25\2\0\1\111" + - "\1\115\3\25\1\0\6\25\25\0\5\25\5\0\1\116" + - "\1\117\5\116\1\117\4\116\3\0\1\117\3\116\1\0" + - "\1\117\3\116\1\117\1\116\25\0\5\116\1\27\3\0" + + "\1\0\1\115\1\112\1\116\3\24\1\0\1\25\3\24" + + "\1\25\1\24\25\0\5\24\5\0\14\25\2\0\1\112" + + "\1\116\3\25\1\0\6\25\25\0\5\25\5\0\1\117" + + "\1\120\5\117\1\120\4\117\3\0\1\120\3\117\1\0" + + "\1\120\3\117\1\120\1\117\25\0\5\117\1\27\3\0" + "\65\27\2\0\1\30\73\0\1\32\1\33\4\32\2\33" + - "\4\32\1\0\1\114\1\0\1\33\3\32\1\0\1\33" + + "\4\32\1\0\1\115\1\0\1\33\3\32\1\0\1\33" + "\3\32\1\33\1\32\25\0\5\32\5\0\14\33\3\0" + "\4\33\1\0\6\33\25\0\5\33\1\34\3\0\65\34" + - "\4\0\1\35\111\0\2\120\1\121\46\0\1\33\1\122" + - "\12\33\3\0\4\33\1\0\1\122\5\33\25\0\5\33" + - "\6\0\1\40\22\0\1\40\3\0\1\40\40\0\3\33" + - "\1\122\10\33\3\0\4\33\1\0\6\33\25\0\2\33" + - "\1\123\2\33\5\0\14\33\3\0\4\33\1\0\6\33" + - "\25\0\2\124\3\33\5\0\1\33\1\125\12\33\3\0" + - "\4\33\1\0\1\125\5\33\25\0\5\33\5\0\2\33" + - "\1\126\11\33\3\0\1\33\1\126\2\33\1\0\6\33" + - "\25\0\5\33\21\0\1\127\54\0\14\33\3\0\1\33" + - "\2\130\1\131\1\0\6\33\25\0\5\33\6\0\1\132" + - "\17\0\1\132\2\0\6\132\26\0\1\132\34\0\1\133" + - "\45\0\1\134\22\0\1\134\37\0\40\135\1\136\1\137" + - "\27\135\41\140\1\141\1\136\26\140\41\142\1\143\1\142" + - "\1\136\25\142\21\0\1\144\22\0\1\145\1\146\44\0" + - "\1\147\23\0\1\150\74\0\1\151\71\0\1\152\37\0" + - "\1\146\54\0\14\33\3\0\4\33\1\0\6\33\25\0" + - "\2\153\3\33\5\0\14\33\3\0\2\33\1\154\1\33" + - "\1\0\6\33\25\0\4\33\1\154\15\0\1\155\20\0" + - "\1\155\50\0\1\156\52\0\2\101\3\0\41\101\2\0" + - "\21\101\2\103\3\157\33\103\1\101\1\160\4\103\2\157" + - "\21\103\2\104\3\161\34\104\1\162\1\101\3\104\2\161" + - "\21\104\2\105\3\163\34\105\1\164\1\105\1\101\2\105" + - "\2\163\21\105\2\106\3\165\34\106\1\166\3\106\1\101" + - "\2\165\21\106\4\0\1\107\2\0\1\167\5\0\1\170" + - "\3\0\1\110\3\0\1\167\10\0\1\170\36\0\1\110" + - "\107\0\1\171\70\0\1\172\52\0\14\113\2\0\1\172" + - "\1\0\3\113\1\0\6\113\25\0\5\113\1\173\3\0" + - "\65\173\5\0\14\117\2\0\1\172\4\117\1\0\6\117" + - "\25\0\5\117\5\0\14\116\2\0\1\172\1\117\3\116" + - "\1\0\6\116\25\0\5\116\5\0\14\117\3\0\4\117" + - "\1\0\6\117\25\0\5\117\5\0\3\33\1\174\10\33" + - "\3\0\4\33\1\0\6\33\25\0\5\33\1\135\3\0" + - "\65\135\1\140\3\0\65\140\1\142\3\0\65\142\5\0" + - "\14\33\3\0\4\33\1\0\6\33\25\0\2\33\1\175" + - "\2\33\5\0\14\33\3\0\4\33\1\0\6\33\25\0" + - "\2\33\1\176\2\33\20\0\1\177\67\0\1\177\51\0" + - "\40\157\1\200\1\201\27\157\1\103\1\101\2\0\1\157" + - "\41\103\2\157\21\103\41\161\1\202\1\200\26\161\1\104" + - "\1\101\2\0\1\161\41\104\2\161\21\104\41\163\1\203" + - "\1\163\1\200\25\163\1\105\1\101\2\0\1\163\41\105" + - "\2\163\21\105\41\165\1\204\3\165\1\200\23\165\1\106" + - "\1\101\2\0\1\165\41\106\2\165\21\106\15\0\1\205" + - "\20\0\1\205\50\0\1\206\52\0\1\157\3\0\65\157" + - "\1\161\3\0\65\161\1\163\3\0\65\163\1\165\3\0" + - "\65\165\20\0\1\207\67\0\1\207\51\0"; + "\4\0\1\35\111\0\2\121\1\122\46\0\1\44\1\123" + + "\12\44\3\0\4\44\1\0\1\123\5\44\25\0\5\44" + + "\6\0\1\40\22\0\1\40\3\0\1\40\40\0\3\44" + + "\1\123\10\44\3\0\4\44\1\0\6\44\25\0\2\44" + + "\1\124\2\44\5\0\14\44\3\0\4\44\1\0\6\44" + + "\25\0\2\125\3\44\5\0\1\44\1\126\12\44\3\0" + + "\4\44\1\0\1\126\5\44\25\0\5\44\5\0\14\44" + + "\3\0\4\44\1\0\6\44\25\0\5\44\5\0\2\44" + + "\1\127\11\44\3\0\1\44\1\127\2\44\1\0\6\44" + + "\25\0\5\44\21\0\1\130\54\0\14\44\3\0\1\44" + + "\2\131\1\132\1\0\6\44\25\0\5\44\6\0\1\133" + + "\17\0\1\133\2\0\6\133\26\0\1\133\34\0\1\134" + + "\45\0\1\135\22\0\1\135\37\0\40\136\1\137\1\140" + + "\27\136\41\141\1\142\1\137\26\141\41\143\1\144\1\143" + + "\1\137\25\143\21\0\1\145\22\0\1\146\1\147\44\0" + + "\1\150\23\0\1\151\74\0\1\152\71\0\1\153\37\0" + + "\1\147\54\0\14\44\3\0\4\44\1\0\6\44\25\0" + + "\2\154\3\44\5\0\14\44\3\0\2\44\1\155\1\44" + + "\1\0\6\44\25\0\4\44\1\155\15\0\1\156\20\0" + + "\1\156\50\0\1\157\52\0\2\102\3\0\41\102\2\0" + + "\21\102\2\104\3\136\33\104\1\102\1\160\4\104\2\136" + + "\21\104\2\105\3\141\34\105\1\161\1\102\3\105\2\141" + + "\21\105\2\106\3\143\34\106\1\162\1\106\1\102\2\106" + + "\2\143\21\106\2\107\3\163\34\107\1\164\3\107\1\102" + + "\2\163\21\107\4\0\1\110\2\0\1\165\5\0\1\166" + + "\3\0\1\111\3\0\1\165\10\0\1\166\36\0\1\111" + + "\107\0\1\167\70\0\1\170\52\0\14\114\2\0\1\170" + + "\1\0\3\114\1\0\6\114\25\0\5\114\1\171\3\0" + + "\65\171\5\0\14\120\2\0\1\170\4\120\1\0\6\120" + + "\25\0\5\120\5\0\14\117\2\0\1\170\1\120\3\117" + + "\1\0\6\117\25\0\5\117\5\0\14\120\3\0\4\120" + + "\1\0\6\120\25\0\5\120\5\0\3\44\1\172\10\44" + + "\3\0\4\44\1\0\6\44\25\0\5\44\1\136\3\0" + + "\65\136\1\141\3\0\65\141\1\143\3\0\65\143\5\0" + + "\14\44\3\0\4\44\1\0\6\44\25\0\2\44\1\173" + + "\2\44\5\0\14\44\3\0\4\44\1\0\6\44\25\0" + + "\2\44\1\174\2\44\20\0\1\175\67\0\1\175\51\0" + + "\1\104\1\102\2\0\1\136\41\104\2\136\21\104\1\105" + + "\1\102\2\0\1\141\41\105\2\141\21\105\1\106\1\102" + + "\2\0\1\143\41\106\2\143\21\106\41\163\1\176\3\163" + + "\1\137\23\163\1\107\1\102\2\0\1\163\41\107\2\163" + + "\21\107\15\0\1\177\20\0\1\177\50\0\1\200\52\0" + + "\1\163\3\0\65\163\20\0\1\201\67\0\1\201\51\0"; private static int[] zzUnpackTrans() { - int[] result = new int[5016]; + int[] result = new int[4731]; int offset = 0; offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); return result; @@ -394,14 +392,14 @@ public class _M68kLexer implements FlexLexer { private static final int[] ZZ_ATTRIBUTE = zzUnpackAttribute(); private static final String ZZ_ATTRIBUTE_PACKED_0 = - "\11\0\2\11\5\1\1\11\6\1\1\11\26\1\2\11" + + "\11\0\2\11\5\1\1\11\6\1\1\11\27\1\2\11" + "\3\1\10\11\4\1\1\11\6\1\1\0\4\1\1\0" + "\3\1\2\11\5\1\1\11\5\1\1\0\1\11\5\0" + - "\7\11\2\1\3\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"; + "\7\11\2\1\2\0\3\1\1\0\1\1\2\0\3\11" + + "\3\1\1\11\4\0"; private static int[] zzUnpackAttribute() { - int[] result = new int[135]; + int[] result = new int[129]; int offset = 0; offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); return result; @@ -724,40 +722,40 @@ public class _M68kLexer implements FlexLexer { return BAD_CHARACTER; } // fall through - case 57: + case 58: break; case 2: { return WHITE_SPACE; } // fall through - case 58: + case 59: break; case 3: { yybegin(NOSOL); return WHITE_SPACE; } // fall through - case 59: + case 60: break; case 4: { yybegin(INSTRPART); return GLOBAL_LABEL_DEF; } // fall through - case 60: + case 61: break; case 5: { return COMMENT; } // fall through - case 61: + case 62: break; case 6: { yybegin(YYINITIAL); return WHITE_SPACE; } // fall through - case 62: + case 63: break; case 7: { if (isAsmMnemonicWithSize(yytext())) { @@ -777,315 +775,322 @@ public class _M68kLexer implements FlexLexer { yybegin(EXPR); return OTHER_DIRECTIVE; } - yybegin(INSTRPART); - return SYMBOL; - } - // fall through - case 63: - break; - case 8: { - yybegin(INSTRPART); - return SYMBOL; + yybegin(MACROCALL); + return MACRO_INVOKATION; } // fall through case 64: break; + case 8: { + yybegin(MACROCALL); + return SYMBOL; + } + // fall through + case 65: + break; case 9: { yybegin(YYINITIAL); return COMMENT; } // fall through - case 65: + case 66: break; case 10: { yybegin(YYINITIAL); return EOL; } // fall through - case 66: + case 67: break; case 11: { - return SYMBOL; + yybegin(MACROCALL); + return MACRO_INVOKATION; } // fall through - case 67: + case 68: break; case 12: { yybegin(WAITEOL); return COMMENT; } // fall through - case 68: + case 69: break; case 13: { yybegin(ASMOPS); return WHITE_SPACE; } // fall through - case 69: - break; - case 14: { - return DECIMAL; - } - // fall through case 70: break; - case 15: { - return OP_ASSIGN; + case 14: { + return SYMBOL; } // fall through case 71: break; - case 16: { - return OP_AR_MOD; + case 15: { + return DECIMAL; } // fall through case 72: break; - case 17: { - return OP_CMP_LT; + case 16: { + return OP_ASSIGN; } // fall through case 73: break; - case 18: { - return OP_CMP_GT; + case 17: { + return OP_AR_MOD; } // fall through case 74: break; - case 19: { - return SEPARATOR; + case 18: { + return OP_CMP_LT; } // fall through case 75: break; - case 20: { - return HASH; + case 19: { + return OP_CMP_GT; } // fall through case 76: break; - case 21: { - return OP_BITWISE_AND; + case 20: { + return SEPARATOR; } // fall through case 77: break; - case 22: { - return OP_BITWISE_OR; + case 21: { + return HASH; } // fall through case 78: break; - case 23: { - return OP_UNARY_NOT; + case 22: { + return OP_BITWISE_AND; } // fall through case 79: break; - case 24: { - return OP_BITWISE_XOR; + case 23: { + return OP_BITWISE_OR; } // fall through case 80: break; - case 25: { - return ROUND_L; + case 24: { + return OP_UNARY_NOT; } // fall through case 81: break; - case 26: { - return ROUND_R; + case 25: { + return OP_BITWISE_XOR; } // fall through case 82: break; - case 27: { - return OP_UNARY_COMPL; + case 26: { + return ROUND_L; } // fall through case 83: break; - case 28: { - return OP_PLUS; + case 27: { + return ROUND_R; } // fall through case 84: break; - case 29: { - return OP_MINUS; + case 28: { + return OP_UNARY_COMPL; } // fall through case 85: break; - case 30: { - return OP_AR_MUL; + case 29: { + return OP_PLUS; } // fall through case 86: break; - case 31: { - return OP_AR_DIV; + case 30: { + return OP_MINUS; } // fall through case 87: break; - case 32: { - yybegin(EXPR); - return OP_ASSIGN; + case 31: { + return OP_AR_MUL; } // fall through case 88: break; + case 32: { + return OP_AR_DIV; + } + // fall through + case 89: + break; case 33: { + yybegin(EXPR); + return OP_ASSIGN; + } + // fall through + case 90: + break; + case 34: { + return STRINGLIT; + } + // fall through + case 91: + break; + case 35: { yybegin(ASSIGNMENT); yypushback(pushbackAssignment(yytext())); return SYMBOLDEF; } // fall through - case 89: + case 92: break; - case 34: { + case 36: { yybegin(INSTRPART); return LOCAL_LABEL_DEF; } // fall through - case 90: - break; - case 35: { - return OPSIZE_BS; - } - // fall through - case 91: - break; - case 36: { - return OPSIZE_WL; - } - // fall through - case 92: - break; - case 37: { - return AREG; - } - // fall through case 93: break; - case 38: { - return REG_SR; + case 37: { + return OPSIZE_BS; } // fall through case 94: break; - case 39: { - return PC; + case 38: { + return OPSIZE_WL; } // fall through case 95: break; - case 40: { - return DREG; + case 39: { + return AREG; } // fall through case 96: break; - case 41: { - return OP_CMP_EQ; + case 40: { + return REG_SR; } // fall through case 97: break; - case 42: { - return HEXADECIMAL; + case 41: { + return PC; } // fall through case 98: break; - case 43: { - return BINARY; + case 42: { + return DREG; } // fall through case 99: break; - case 44: { - return OCTAL; + case 43: { + return OP_CMP_EQ; } // fall through case 100: break; - case 45: { - return STRINGLIT; + case 44: { + return HEXADECIMAL; } // fall through case 101: break; - case 46: { - return OP_CMP_LT_EQ; + case 45: { + return BINARY; } // fall through case 102: break; - case 47: { - return OP_AR_SHIFT_L; + case 46: { + return OCTAL; } // fall through case 103: break; - case 48: { - return OP_CMP_NOT_EQ; + case 47: { + return OP_CMP_LT_EQ; } // fall through case 104: break; - case 49: { - return OP_CMP_GT_EQ; + case 48: { + return OP_AR_SHIFT_L; } // fall through case 105: break; - case 50: { - return OP_AR_SHIFT_R; + case 49: { + return OP_CMP_NOT_EQ; } // fall through case 106: break; - case 51: { - return OP_LOGICAL_AND; + case 50: { + return OP_CMP_GT_EQ; } // fall through case 107: break; - case 52: { - return OP_LOGICAL_OR; + case 51: { + return OP_AR_SHIFT_R; } // fall through case 108: break; - case 53: { - return REG_USP; + case 52: { + return OP_LOGICAL_AND; } // fall through case 109: break; - case 54: { - return REG_CCR; + case 53: { + return OP_LOGICAL_OR; } // fall through case 110: break; - case 55: { - return REG_VBR; + case 54: { + return REG_USP; } // fall through case 111: break; + case 55: { + return REG_CCR; + } + // fall through + case 112: + break; case 56: { + return REG_VBR; + } + // fall through + case 113: + break; + case 57: { yybegin(EXPR); return EQU; } // fall through - case 112: + case 114: break; default: zzScanError(ZZ_NO_MATCH); diff --git a/src/main/gen/de/platon42/intellij/plugins/m68k/parser/M68kParser.java b/src/main/gen/de/platon42/intellij/plugins/m68k/parser/M68kParser.java index a7fc3fb..296d2d1 100644 --- a/src/main/gen/de/platon42/intellij/plugins/m68k/parser/M68kParser.java +++ b/src/main/gen/de/platon42/intellij/plugins/m68k/parser/M68kParser.java @@ -530,7 +530,7 @@ public class M68kParser implements PsiParser, LightPsiParser { // AsmInstruction | MacroCall static boolean Instruction(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "Instruction")) return false; - if (!nextTokenIs(b, "", MNEMONIC, SYMBOL)) return false; + if (!nextTokenIs(b, "", MACRO_INVOKATION, MNEMONIC)) return false; boolean r; r = AsmInstruction(b, l + 1); if (!r) r = MacroCall(b, l + 1); @@ -611,22 +611,22 @@ public class M68kParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // SYMBOL PreprocessorOperands? + // MACRO_INVOKATION PlainOperands? public static boolean MacroCall(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "MacroCall")) return false; - if (!nextTokenIs(b, SYMBOL)) return false; + if (!nextTokenIs(b, MACRO_INVOKATION)) return false; boolean r; Marker m = enter_section_(b); - r = consumeToken(b, SYMBOL); + r = consumeToken(b, MACRO_INVOKATION); r = r && MacroCall_1(b, l + 1); exit_section_(b, m, MACRO_CALL, r); return r; } - // PreprocessorOperands? + // PlainOperands? private static boolean MacroCall_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "MacroCall_1")) return false; - PreprocessorOperands(b, l + 1); + PlainOperands(b, l + 1); return true; } @@ -643,6 +643,40 @@ public class M68kParser implements PsiParser, LightPsiParser { return r; } + /* ********************************************************** */ + // STRINGLIT (SEPARATOR STRINGLIT)* + static boolean PlainOperands(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "PlainOperands")) return false; + if (!nextTokenIs(b, STRINGLIT)) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, STRINGLIT); + r = r && PlainOperands_1(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + // (SEPARATOR STRINGLIT)* + private static boolean PlainOperands_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "PlainOperands_1")) return false; + while (true) { + int c = current_position_(b); + if (!PlainOperands_1_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "PlainOperands_1", c)) break; + } + return true; + } + + // SEPARATOR STRINGLIT + private static boolean PlainOperands_1_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "PlainOperands_1_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeTokens(b, 0, SEPARATOR, STRINGLIT); + exit_section_(b, m, null, r); + return r; + } + /* ********************************************************** */ // Label? (DATA_DIRECTIVE | OTHER_DIRECTIVE) // PreprocessorOperands? diff --git a/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kMacroCall.java b/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kMacroCall.java index 6c912e2..7016abf 100644 --- a/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kMacroCall.java +++ b/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kMacroCall.java @@ -2,13 +2,7 @@ package de.platon42.intellij.plugins.m68k.psi; import com.intellij.psi.PsiElement; -import org.jetbrains.annotations.NotNull; - -import java.util.List; public interface M68kMacroCall extends PsiElement { - @NotNull - List getExprList(); - } diff --git a/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kTypes.java b/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kTypes.java index 2efd92b..f3beb35 100644 --- a/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kTypes.java +++ b/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kTypes.java @@ -81,6 +81,7 @@ public interface M68kTypes { IElementType HASH = new M68kTokenType("HASH"); IElementType HEXADECIMAL = new M68kTokenType("HEXADECIMAL"); IElementType LOCAL_LABEL_DEF = new M68kTokenType("LOCAL_LABEL_DEF"); + IElementType MACRO_INVOKATION = new M68kTokenType("MACRO_INVOKATION"); IElementType MNEMONIC = new M68kTokenType("MNEMONIC"); IElementType OCTAL = new M68kTokenType("OCTAL"); IElementType OPSIZE_BS = new M68kTokenType("OPSIZE_BS"); diff --git a/src/main/gen/de/platon42/intellij/plugins/m68k/psi/impl/M68kMacroCallImpl.java b/src/main/gen/de/platon42/intellij/plugins/m68k/psi/impl/M68kMacroCallImpl.java index 1fa91cd..37c3780 100644 --- a/src/main/gen/de/platon42/intellij/plugins/m68k/psi/impl/M68kMacroCallImpl.java +++ b/src/main/gen/de/platon42/intellij/plugins/m68k/psi/impl/M68kMacroCallImpl.java @@ -4,14 +4,10 @@ package de.platon42.intellij.plugins.m68k.psi.impl; import com.intellij.extapi.psi.ASTWrapperPsiElement; import com.intellij.lang.ASTNode; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import de.platon42.intellij.plugins.m68k.psi.M68kExpr; import de.platon42.intellij.plugins.m68k.psi.M68kMacroCall; import de.platon42.intellij.plugins.m68k.psi.M68kVisitor; import org.jetbrains.annotations.NotNull; -import java.util.List; - public class M68kMacroCallImpl extends ASTWrapperPsiElement implements M68kMacroCall { public M68kMacroCallImpl(@NotNull ASTNode node) { @@ -28,10 +24,4 @@ public class M68kMacroCallImpl extends ASTWrapperPsiElement implements M68kMacro else super.accept(visitor); } - @Override - @NotNull - public List getExprList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, M68kExpr.class); - } - } 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 6f0a1f0..d6fb1f6 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 @@ -29,7 +29,7 @@ object AssemblerDirectives { //"iif" // not supported "else", "endif", "endc", - "macro", "exitm", "mexit", + "macro", "exitm", "mexit", "endm", "extern", "nref", "xdef", "xref", "globl", "public", "weak", 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 347a709..d790e53 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 @@ -70,10 +70,10 @@ HASH_COMMENT=([#;*].*+) if(isAsmMnemonic(yytext())) { yybegin(ASMINSTR); return MNEMONIC; } if(isDataDirective(yytext())) { yybegin(EXPR); return DATA_DIRECTIVE; } if(isOtherDirective(yytext())) { yybegin(EXPR); return OTHER_DIRECTIVE; } - yybegin(INSTRPART); return SYMBOL; + yybegin(MACROCALL); return MACRO_INVOKATION; } // {MNEMONIC} { if(isAsmMnemonic(yytext())) { yybegin(ASMINSTR); return MNEMONIC; } else { yybegin(INSTRPART); return SYMBOL; } } - {SYMBOL} { yybegin(INSTRPART); return SYMBOL; } + {SYMBOL} { yybegin(MACROCALL); return SYMBOL; } {HASH_COMMENT} { yybegin(YYINITIAL); return COMMENT; } } @@ -86,10 +86,10 @@ HASH_COMMENT=([#;*].*+) if(isAsmMnemonic(yytext())) { yybegin(ASMINSTR); return MNEMONIC; } if(isDataDirective(yytext())) { yybegin(EXPR); return DATA_DIRECTIVE; } if(isOtherDirective(yytext())) { yybegin(EXPR); return OTHER_DIRECTIVE; } - yybegin(INSTRPART); return SYMBOL; + yybegin(MACROCALL); return MACRO_INVOKATION; } // {MNEMONIC} { if(isAsmMnemonic(yytext())) { yybegin(ASMINSTR); return MNEMONIC; } else { return SYMBOL; } } - {SYMBOL} { return SYMBOL; } + {SYMBOL} { yybegin(MACROCALL); return MACRO_INVOKATION; } {COMMENT} { yybegin(WAITEOL); return COMMENT; } } @@ -112,7 +112,7 @@ HASH_COMMENT=([#;*].*+) "," { return SEPARATOR; } - {PLAINPARAM} { return SYMBOL; } + {PLAINPARAM} { return STRINGLIT; } } { diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/m68k.bnf b/src/main/java/de/platon42/intellij/plugins/m68k/m68k.bnf index 34d4854..94939c6 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/m68k.bnf +++ b/src/main/java/de/platon42/intellij/plugins/m68k/m68k.bnf @@ -147,7 +147,7 @@ AsmOp ::= MNEMONIC OperandSize? PreprocessorDirective ::= Label? (DATA_DIRECTIVE | OTHER_DIRECTIVE) PreprocessorOperands? -MacroCall ::= SYMBOL PreprocessorOperands? +MacroCall ::= MACRO_INVOKATION PlainOperands? AsmInstruction ::= AsmOp AsmOperands? private Instruction ::= AsmInstruction | MacroCall //external Instruction ::= parseMacroCallOrAsmInstruction @@ -155,9 +155,10 @@ private Instruction ::= AsmInstruction | MacroCall private AsmOperands ::= AddressingMode (SEPARATOR AddressingMode)? private PreprocessorOperands ::= PreprocessorOperand (SEPARATOR PreprocessorOperand)* - private PreprocessorOperand ::= expr +private PlainOperands ::= STRINGLIT (SEPARATOR STRINGLIT)* + DataRegister ::= DREG {extends=Register} AddressRegister ::= AREG {extends=Register} SpecialRegister ::= REG_CCR | REG_SR | REG_USP | REG_VBR {extends=Register} diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kColorSettingsPage.kt b/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kColorSettingsPage.kt index 79499c0..e2af42a 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kColorSettingsPage.kt +++ b/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kColorSettingsPage.kt @@ -10,17 +10,20 @@ import de.platon42.intellij.plugins.m68k.M68kIcons.FILE import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.AREG import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.BAD_CHARACTER import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.COMMENT +import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.DATA_PREPROCESSOR +import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.DATA_WIDTH import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.DREG import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.GLOBAL_LABEL -import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.KEYWORD import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.LOCAL_LABEL +import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.MACRO_CALL import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.MNEMONIC import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.NUMBER -import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.PREPROCESSOR +import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.OTHER_PREPROCESSOR import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.SEPARATOR import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.SPECIAL_REG import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.STRING import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.SYMBOL +import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.SYMBOLDEF import org.jetbrains.annotations.NonNls import javax.swing.Icon @@ -54,6 +57,9 @@ demo_init ; global label dbra d7,.loop POPM rts + +hello: dc.b 'Hello World!',10,0 + even """ } @@ -75,19 +81,22 @@ demo_init ; global label companion object { private val DESCRIPTORS = arrayOf( - AttributesDescriptor("SEPARATOR", SEPARATOR), - AttributesDescriptor("GLOBAL_LABEL", GLOBAL_LABEL), - AttributesDescriptor("LOCAL_LABEL", LOCAL_LABEL), - AttributesDescriptor("SYMBOL", SYMBOL), - AttributesDescriptor("MNEMONIC", MNEMONIC), - AttributesDescriptor("KEYWORD", KEYWORD), - AttributesDescriptor("PREPROCESSOR", PREPROCESSOR), - AttributesDescriptor("STRING", STRING), - AttributesDescriptor("NUMBER", NUMBER), - AttributesDescriptor("AREG", AREG), - AttributesDescriptor("DREG", DREG), - AttributesDescriptor("SPECIAL_REG", SPECIAL_REG), - AttributesDescriptor("COMMENT", COMMENT), - AttributesDescriptor("BAD_CHARACTER", BAD_CHARACTER)) + AttributesDescriptor("Global labels", GLOBAL_LABEL), + AttributesDescriptor("Local labels", LOCAL_LABEL), + AttributesDescriptor("Comma (separator)", SEPARATOR), + AttributesDescriptor("Symbol definition", SYMBOLDEF), + AttributesDescriptor("Symbol reference", SYMBOL), + AttributesDescriptor("Assembly mnemonic", MNEMONIC), + AttributesDescriptor("Macro invocation", MACRO_CALL), + AttributesDescriptor("Data/address width", DATA_WIDTH), + AttributesDescriptor("Data preprocessor directives", DATA_PREPROCESSOR), + AttributesDescriptor("Other preprocessor directives", OTHER_PREPROCESSOR), + AttributesDescriptor("Strings", STRING), + AttributesDescriptor("Numbers", NUMBER), + AttributesDescriptor("Address registers", AREG), + AttributesDescriptor("Data registers", DREG), + AttributesDescriptor("Special registers", SPECIAL_REG), + AttributesDescriptor("Comments", COMMENT), + AttributesDescriptor("Bad characters", BAD_CHARACTER)) } } \ No newline at end of file diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kSyntaxHighlighter.kt b/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kSyntaxHighlighter.kt index 7287f5f..74f2ca2 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kSyntaxHighlighter.kt +++ b/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kSyntaxHighlighter.kt @@ -19,14 +19,17 @@ class M68kSyntaxHighlighter : SyntaxHighlighterBase() { return when (tokenType) { M68kTypes.SEPARATOR -> arrayOf(SEPARATOR) M68kTypes.GLOBAL_LABEL_DEF, M68kTypes.GLOBAL_LABEL -> arrayOf(GLOBAL_LABEL) - M68kTypes.LOCAL_LABEL_DEF, M68kTypes.LOCAL_LABEL_DEF -> arrayOf(LOCAL_LABEL) - M68kTypes.SYMBOLDEF, M68kTypes.SYMBOL -> arrayOf(SYMBOL) - M68kTypes.MNEMONIC, M68kTypes.ASM_OP -> arrayOf(MNEMONIC) - M68kTypes.OPERAND_SIZE, M68kTypes.DATA_WIDTH, M68kTypes.ADDRESS_SIZE -> arrayOf(MNEMONIC) + M68kTypes.LOCAL_LABEL_DEF, M68kTypes.LOCAL_LABEL -> arrayOf(LOCAL_LABEL) + M68kTypes.SYMBOLDEF -> arrayOf(SYMBOLDEF) + M68kTypes.SYMBOL -> arrayOf(SYMBOL) + M68kTypes.MNEMONIC -> arrayOf(MNEMONIC) + M68kTypes.MACRO_INVOKATION -> arrayOf(MACRO_CALL) + M68kTypes.DATA_DIRECTIVE -> arrayOf(DATA_PREPROCESSOR) + M68kTypes.OTHER_DIRECTIVE -> arrayOf(OTHER_PREPROCESSOR) + M68kTypes.OPSIZE_BS, M68kTypes.OPSIZE_WL -> arrayOf(DATA_WIDTH) M68kTypes.ADDRESS_REGISTER, M68kTypes.AREG -> arrayOf(AREG) M68kTypes.DATA_REGISTER, M68kTypes.DREG -> arrayOf(DREG) M68kTypes.SPECIAL_REGISTER, M68kTypes.REG_USP, M68kTypes.REG_SR, M68kTypes.REG_CCR -> arrayOf(SPECIAL_REG) - M68kTypes.PREPROCESSOR_DIRECTIVE -> arrayOf(PREPROCESSOR) M68kTypes.COMMENT -> arrayOf(COMMENT) M68kTypes.DECIMAL, M68kTypes.HEXADECIMAL, M68kTypes.OCTAL -> arrayOf(NUMBER) M68kTypes.STRINGLIT -> arrayOf(STRING) @@ -36,18 +39,21 @@ class M68kSyntaxHighlighter : SyntaxHighlighterBase() { } companion object { - val SEPARATOR = TextAttributesKey.createTextAttributesKey("M68K_SEPARATOR", DefaultLanguageHighlighterColors.COMMA) val GLOBAL_LABEL = TextAttributesKey.createTextAttributesKey("M68K_LOCAL_LABEL", DefaultLanguageHighlighterColors.LOCAL_VARIABLE) val LOCAL_LABEL = TextAttributesKey.createTextAttributesKey("M68K_GLOBAL_LABEL", DefaultLanguageHighlighterColors.GLOBAL_VARIABLE) + val SEPARATOR = TextAttributesKey.createTextAttributesKey("M68K_SEPARATOR", DefaultLanguageHighlighterColors.COMMA) + val SYMBOLDEF = TextAttributesKey.createTextAttributesKey("M68K_SYMBOLDEF", DefaultLanguageHighlighterColors.STATIC_FIELD) val SYMBOL = TextAttributesKey.createTextAttributesKey("M68K_SYMBOL", DefaultLanguageHighlighterColors.IDENTIFIER) val MNEMONIC = TextAttributesKey.createTextAttributesKey("M68K_MNEMONIC", DefaultLanguageHighlighterColors.FUNCTION_CALL) - val KEYWORD = TextAttributesKey.createTextAttributesKey("M68K_KEYWORD", DefaultLanguageHighlighterColors.KEYWORD) - val PREPROCESSOR = TextAttributesKey.createTextAttributesKey("M68K_PREPROCESSOR", DefaultLanguageHighlighterColors.KEYWORD) + val MACRO_CALL = TextAttributesKey.createTextAttributesKey("M68K_MACRO_CALL", DefaultLanguageHighlighterColors.STATIC_METHOD) + val DATA_WIDTH = TextAttributesKey.createTextAttributesKey("M68K_DATA_WIDTH", DefaultLanguageHighlighterColors.INSTANCE_METHOD) + val DATA_PREPROCESSOR = TextAttributesKey.createTextAttributesKey("M68K_DATA_PREPROCESSOR", DefaultLanguageHighlighterColors.CONSTANT) + val OTHER_PREPROCESSOR = TextAttributesKey.createTextAttributesKey("M68K_OTHER_PREPROCESSOR", DefaultLanguageHighlighterColors.KEYWORD) val STRING = TextAttributesKey.createTextAttributesKey("M68K_STRING", DefaultLanguageHighlighterColors.STRING) val NUMBER = TextAttributesKey.createTextAttributesKey("M68K_NUMBER", DefaultLanguageHighlighterColors.NUMBER) - val AREG = TextAttributesKey.createTextAttributesKey("M68K_AREG", DefaultLanguageHighlighterColors.CONSTANT) - val DREG = TextAttributesKey.createTextAttributesKey("M68K_DREG", DefaultLanguageHighlighterColors.CONSTANT) - val SPECIAL_REG = TextAttributesKey.createTextAttributesKey("M68K_SPECIALREG", DefaultLanguageHighlighterColors.CONSTANT) + val AREG = TextAttributesKey.createTextAttributesKey("M68K_AREG", DefaultLanguageHighlighterColors.PREDEFINED_SYMBOL) + val DREG = TextAttributesKey.createTextAttributesKey("M68K_DREG", DefaultLanguageHighlighterColors.PREDEFINED_SYMBOL) + val SPECIAL_REG = TextAttributesKey.createTextAttributesKey("M68K_SPECIALREG", DefaultLanguageHighlighterColors.PREDEFINED_SYMBOL) val COMMENT = TextAttributesKey.createTextAttributesKey("M68K_COMMENT", DefaultLanguageHighlighterColors.LINE_COMMENT) val BAD_CHARACTER = TextAttributesKey.createTextAttributesKey("M68K_BAD_CHARACTER", HighlighterColors.BAD_CHARACTER) } diff --git a/src/test/java/de/platon42/intellij/plugins/m68k/parser/MacroCallTest.kt b/src/test/java/de/platon42/intellij/plugins/m68k/parser/MacroCallTest.kt new file mode 100644 index 0000000..ecf8074 --- /dev/null +++ b/src/test/java/de/platon42/intellij/plugins/m68k/parser/MacroCallTest.kt @@ -0,0 +1,31 @@ +package de.platon42.intellij.plugins.m68k.parser + +import de.platon42.intellij.jupiter.MyTestCase +import de.platon42.intellij.jupiter.ParsingTestExtension +import de.platon42.intellij.jupiter.TestDataSubPath +import org.junit.jupiter.api.Test + +@TestDataSubPath("macros") +internal class MacroCallTest : AbstractParsingTest() { + + @Test + internal fun standard_macrocall_without_parameters(@MyTestCase testCase: ParsingTestExtension.IParsingTestCase) { + testGoodSyntax(testCase, " BLTHOGON\n") + } + + @Test + internal fun call_with_complex_parameters(@MyTestCase testCase: ParsingTestExtension.IParsingTestCase) { + testGoodSyntax(testCase, " COPIMOVE (3<<0)|(3<<3)|(1<<6),bplcon2\n") + } + + @Test + internal fun pushm_call_with_register_list(@MyTestCase testCase: ParsingTestExtension.IParsingTestCase) { + testGoodSyntax(testCase, " PUSHM d0/d3/d5-d7/a0-a2/a4-a6 ; save a couple of registers\n") + } + + @Test + internal fun putmsg_call_with_specially_bracketed_parameters(@MyTestCase testCase: ParsingTestExtension.IParsingTestCase) { + // FIXME this doesn't work as intended... + testGoodSyntax(testCase, "\tPUTMSG 10,<\"%s has left the building at %d:%d\",10,'Yup!'>,a0,$42(a1,d0.w),#42\n") + } +} \ No newline at end of file diff --git a/src/test/resources/parser/labels/bad_indented_dot_local_label_without_label.txt b/src/test/resources/parser/labels/bad_indented_dot_local_label_without_label.txt index f6f76a0..3ebbc11 100644 --- a/src/test/resources/parser/labels/bad_indented_dot_local_label_without_label.txt +++ b/src/test/resources/parser/labels/bad_indented_dot_local_label_without_label.txt @@ -1,6 +1,5 @@ Assembly File: a.asm PsiWhiteSpace(' ') - M68kStatementImpl(STATEMENT) - M68kMacroCallImpl(MACRO_CALL) - PsiElement(M68kTokenType.SYMBOL)('.local_label') + PsiErrorElement:'.local_label' unexpected + PsiElement(M68kTokenType.SYMBOL)('.local_label') PsiElement(M68kTokenType.EOL)('\n') \ No newline at end of file diff --git a/src/test/resources/parser/labels/bad_indented_local_label_dollar_without_label.txt b/src/test/resources/parser/labels/bad_indented_local_label_dollar_without_label.txt index 5a2018f..bda62b3 100644 --- a/src/test/resources/parser/labels/bad_indented_local_label_dollar_without_label.txt +++ b/src/test/resources/parser/labels/bad_indented_local_label_dollar_without_label.txt @@ -1,6 +1,5 @@ Assembly File: a.asm PsiWhiteSpace(' ') - M68kStatementImpl(STATEMENT) - M68kMacroCallImpl(MACRO_CALL) - PsiElement(M68kTokenType.SYMBOL)('local_label$') + PsiErrorElement:'local_label$' unexpected + PsiElement(M68kTokenType.SYMBOL)('local_label$') PsiElement(M68kTokenType.EOL)('\n') \ No newline at end of file diff --git a/src/test/resources/parser/macros/call_with_complex_parameters.txt b/src/test/resources/parser/macros/call_with_complex_parameters.txt new file mode 100644 index 0000000..094dfbb --- /dev/null +++ b/src/test/resources/parser/macros/call_with_complex_parameters.txt @@ -0,0 +1,10 @@ +Assembly File: a.asm + PsiWhiteSpace(' ') + M68kStatementImpl(STATEMENT) + M68kMacroCallImpl(MACRO_CALL) + PsiElement(M68kTokenType.MACRO_INVOKATION)('COPIMOVE') + PsiWhiteSpace(' ') + PsiElement(M68kTokenType.STRINGLIT)('(3<<0)|(3<<3)|(1<<6)') + PsiElement(M68kTokenType.SEPARATOR)(',') + PsiElement(M68kTokenType.STRINGLIT)('bplcon2') + PsiElement(M68kTokenType.EOL)('\n') \ No newline at end of file diff --git a/src/test/resources/parser/macros/pushm_call_with_register_list.txt b/src/test/resources/parser/macros/pushm_call_with_register_list.txt new file mode 100644 index 0000000..b64062f --- /dev/null +++ b/src/test/resources/parser/macros/pushm_call_with_register_list.txt @@ -0,0 +1,10 @@ +Assembly File: a.asm + PsiWhiteSpace(' ') + M68kStatementImpl(STATEMENT) + M68kMacroCallImpl(MACRO_CALL) + PsiElement(M68kTokenType.MACRO_INVOKATION)('PUSHM') + PsiWhiteSpace(' ') + PsiElement(M68kTokenType.STRINGLIT)('d0/d3/d5-d7/a0-a2/a4-a6') + PsiWhiteSpace(' ') + PsiComment(M68kTokenType.COMMENT)('; save a couple of registers') + PsiElement(M68kTokenType.EOL)('\n') \ No newline at end of file diff --git a/src/test/resources/parser/macros/putmsg_call_with_specially_bracketed_parameters.txt b/src/test/resources/parser/macros/putmsg_call_with_specially_bracketed_parameters.txt new file mode 100644 index 0000000..8b3b3dd --- /dev/null +++ b/src/test/resources/parser/macros/putmsg_call_with_specially_bracketed_parameters.txt @@ -0,0 +1,18 @@ +Assembly File: a.asm + PsiWhiteSpace('\t') + M68kStatementImpl(STATEMENT) + M68kMacroCallImpl(MACRO_CALL) + PsiElement(M68kTokenType.MACRO_INVOKATION)('PUTMSG') + PsiWhiteSpace(' ') + PsiElement(M68kTokenType.STRINGLIT)('10') + PsiElement(M68kTokenType.SEPARATOR)(',') + PsiElement(M68kTokenType.STRINGLIT)('<"%s has left the building at %d:%d",10,'Yup!'>') + PsiElement(M68kTokenType.SEPARATOR)(',') + PsiElement(M68kTokenType.STRINGLIT)('a0') + PsiElement(M68kTokenType.SEPARATOR)(',') + PsiElement(M68kTokenType.STRINGLIT)('$42(a1') + PsiElement(M68kTokenType.SEPARATOR)(',') + PsiElement(M68kTokenType.STRINGLIT)('d0.w)') + PsiElement(M68kTokenType.SEPARATOR)(',') + PsiElement(M68kTokenType.STRINGLIT)('#42') + PsiElement(M68kTokenType.EOL)('\n') \ No newline at end of file diff --git a/src/test/resources/parser/macros/standard_macrocall_without_parameters.txt b/src/test/resources/parser/macros/standard_macrocall_without_parameters.txt new file mode 100644 index 0000000..a026fe7 --- /dev/null +++ b/src/test/resources/parser/macros/standard_macrocall_without_parameters.txt @@ -0,0 +1,6 @@ +Assembly File: a.asm + PsiWhiteSpace(' ') + M68kStatementImpl(STATEMENT) + M68kMacroCallImpl(MACRO_CALL) + PsiElement(M68kTokenType.MACRO_INVOKATION)('BLTHOGON') + PsiElement(M68kTokenType.EOL)('\n') \ No newline at end of file