Reduced lexer code by combining state rules. Removed one rule, that seemed to be wrong.
This commit is contained in:
parent
3de9e9eba2
commit
fa1ef0b3d5
@ -71,14 +71,15 @@ make it work with JUnit 5. Feel free to use the code (in package ```de.platon42.
|
|||||||
|
|
||||||
### V0.3 (unreleased)
|
### V0.3 (unreleased)
|
||||||
|
|
||||||
- Enhancement: Macros contents are no longer parsed, added syntax highlighting options for macros.
|
- Enhancement: Macro contents are no longer parsed, added syntax highlighting options for macros.
|
||||||
- Enhancement: Macro definitions are now word and stub indexed, macro calls reference to definition.
|
- Enhancement: Macro definitions are now word and stub indexed, macro calls reference to definition.
|
||||||
- Enhancement: Macro definition refactoring and find usages support.
|
- Enhancement: Macro definition refactoring and find usages support.
|
||||||
- Enhancement: Structural View also shows macro definitions.
|
- Enhancement: Structural View also shows macro definitions.
|
||||||
- Bugfix: Missing REPT and ENDR assembler directives added.
|
- Bugfix: Missing REPT and ENDR assembler directives added.
|
||||||
- Cosmetics: Changed or added some icons at various places.
|
- Cosmetics: Changed or added some icons at various places.
|
||||||
- Performance: Reference search for global labels and symbols now uses stub index.
|
- Performance: Reference search for global labels and symbols now uses stub index.
|
||||||
- Compatibility: Restored compatibility with IDEs versions < 2021.1.
|
- Compatibility: Restored compatibility with IDE versions < 2021.1.
|
||||||
|
- Performance: Optimized lexer.
|
||||||
|
|
||||||
### V0.2 (27-Jul-21)
|
### V0.2 (27-Jul-21)
|
||||||
|
|
||||||
|
@ -58,14 +58,15 @@ patchPluginXml {
|
|||||||
setChangeNotes("""
|
setChangeNotes("""
|
||||||
<h4>V0.3 (unreleased)</h4>
|
<h4>V0.3 (unreleased)</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Enhancement: Macros contents are no longer parsed, added syntax highlighting options for macros.
|
<li>Enhancement: Macro contents are no longer parsed, added syntax highlighting options for macros.
|
||||||
<li>Enhancement: Macro definitions are now word and stub indexed, macro calls reference to definition.
|
<li>Enhancement: Macro definitions are now word and stub indexed, macro calls reference to definition.
|
||||||
<li>Enhancement: Macro definition refactoring and find usages support.
|
<li>Enhancement: Macro definition refactoring and find usages support.
|
||||||
<li>Enhancement: Structural View also shows macro definitions.
|
<li>Enhancement: Structural View also shows macro definitions.
|
||||||
<li>Bugfix: Missing REPT and ENDR assembler directives added.
|
<li>Bugfix: Missing REPT and ENDR assembler directives added.
|
||||||
<li>Cosmetics: Changed or added some icons at various places.
|
<li>Cosmetics: Changed or added some icons at various places.
|
||||||
<li>Performance: Reference search for global labels and symbols now uses stub index.
|
<li>Performance: Reference search for global labels and symbols now uses stub index.
|
||||||
<li>Compatibility: Restored compatibility with IDEs versions < 2021.1.
|
<li>Compatibility: Restored compatibility with IDE versions < 2021.1.
|
||||||
|
<li>Performance: Optimized lexer.
|
||||||
</ul>
|
</ul>
|
||||||
<h4>V0.2 (27-Jul-21)</h4>
|
<h4>V0.2 (27-Jul-21)</h4>
|
||||||
<ul>
|
<ul>
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -14,6 +14,8 @@ import static de.platon42.intellij.plugins.m68k.lexer.LexerUtil.*;
|
|||||||
private M68kLexerPrefs lexerPrefs;
|
private M68kLexerPrefs lexerPrefs;
|
||||||
boolean eatOneWhitespace = false;
|
boolean eatOneWhitespace = false;
|
||||||
int macroLines = 0;
|
int macroLines = 0;
|
||||||
|
int exprState = 0;
|
||||||
|
int exprOpState = 0;
|
||||||
|
|
||||||
public M68kLexerPrefs getLexerPrefs()
|
public M68kLexerPrefs getLexerPrefs()
|
||||||
{
|
{
|
||||||
@ -24,6 +26,12 @@ import static de.platon42.intellij.plugins.m68k.lexer.LexerUtil.*;
|
|||||||
this((java.io.Reader)null);
|
this((java.io.Reader)null);
|
||||||
this.lexerPrefs = lexerPrefs;
|
this.lexerPrefs = lexerPrefs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void startExpr(int newExprState, int newExprOpState) {
|
||||||
|
exprState = newExprState;
|
||||||
|
exprOpState = newExprOpState;
|
||||||
|
yybegin(exprState);
|
||||||
|
}
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%public
|
%public
|
||||||
@ -67,225 +75,154 @@ PLAIN_MACRO_LINE=[^;\r\n]+
|
|||||||
%state NOSOL,INSTRPART,ASMINSTR,ASMOPS,ASMOPS_OP,ASSIGNMENT,EXPR,EXPR_OP,MACROCALL,WAITEOL,MACRODEF,MACROLINE,MACROTERMINATION,MACROWAITEOL
|
%state NOSOL,INSTRPART,ASMINSTR,ASMOPS,ASMOPS_OP,ASSIGNMENT,EXPR,EXPR_OP,MACROCALL,WAITEOL,MACRODEF,MACROLINE,MACROTERMINATION,MACROWAITEOL
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
<YYINITIAL, NOSOL>
|
||||||
|
{
|
||||||
|
{EOL} { yybegin(YYINITIAL); return WHITE_SPACE; }
|
||||||
|
{HASH_COMMENT} { yybegin(YYINITIAL); return COMMENT; }
|
||||||
|
}
|
||||||
|
|
||||||
|
<INSTRPART,ASMINSTR,MACROCALL,ASSIGNMENT,EXPR,EXPR_OP,ASMOPS,ASMOPS_OP>
|
||||||
|
{
|
||||||
|
{EOL} { yybegin(YYINITIAL); return EOL; }
|
||||||
|
{COMMENT} { yybegin(WAITEOL); return COMMENT; }
|
||||||
|
}
|
||||||
|
|
||||||
|
<NOSOL, INSTRPART, ASSIGNMENT>
|
||||||
|
{
|
||||||
|
{WHITE_SPACE} { return WHITE_SPACE; }
|
||||||
|
}
|
||||||
|
|
||||||
|
<MACROCALL, EXPR, EXPR_OP, ASMOPS, ASMOPS_OP> {
|
||||||
|
{WHITE_SPACE} { return handleEolCommentWhitespace(this); }
|
||||||
|
}
|
||||||
|
|
||||||
<YYINITIAL> {
|
<YYINITIAL> {
|
||||||
{WHITE_SPACE} { yybegin(NOSOL); eatOneWhitespace = false; return WHITE_SPACE; }
|
{WHITE_SPACE} { yybegin(NOSOL); eatOneWhitespace = false; return WHITE_SPACE; }
|
||||||
{EOL} { return WHITE_SPACE; }
|
|
||||||
{ASSIGNMENT} { yybegin(ASSIGNMENT); eatOneWhitespace = true; yypushback(pushbackAssignment(yytext())); return SYMBOLDEF; }
|
{ASSIGNMENT} { yybegin(ASSIGNMENT); eatOneWhitespace = true; yypushback(pushbackAssignment(yytext())); return SYMBOLDEF; }
|
||||||
{MACRO_DEF_LEFT} { yybegin(MACRODEF); yypushback(pushbackAfterFirstToken(yytext())); return MACRO_NAME; }
|
{MACRO_DEF_LEFT} { yybegin(MACRODEF); yypushback(pushbackAfterFirstToken(yytext())); return MACRO_NAME; }
|
||||||
{LOCAL_LABEL} { yybegin(INSTRPART); eatOneWhitespace = false; yypushback(pushbackLabelColons(yytext())); return LOCAL_LABEL_DEF; }
|
{LOCAL_LABEL} { yybegin(INSTRPART); eatOneWhitespace = false; yypushback(pushbackLabelColons(yytext())); return LOCAL_LABEL_DEF; }
|
||||||
{GLOBAL_LABEL} { yybegin(INSTRPART); eatOneWhitespace = false; yypushback(pushbackLabelColons(yytext())); return GLOBAL_LABEL_DEF; }
|
{GLOBAL_LABEL} { yybegin(INSTRPART); eatOneWhitespace = false; yypushback(pushbackLabelColons(yytext())); return GLOBAL_LABEL_DEF; }
|
||||||
|
|
||||||
{HASH_COMMENT} { return COMMENT; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<NOSOL> {
|
<NOSOL> {
|
||||||
{WHITE_SPACE} { return WHITE_SPACE; }
|
"macro" { yybegin(MACRODEF); return MACRO_TAG; }
|
||||||
{EOL} { yybegin(YYINITIAL); return WHITE_SPACE; }
|
|
||||||
{LOCAL_LABEL_WC} { yybegin(INSTRPART); yypushback(pushbackLabelColons(yytext())); return LOCAL_LABEL_DEF; }
|
{LOCAL_LABEL_WC} { yybegin(INSTRPART); yypushback(pushbackLabelColons(yytext())); return LOCAL_LABEL_DEF; }
|
||||||
{GLOBAL_LABEL_WC} { yybegin(INSTRPART); yypushback(pushbackLabelColons(yytext())); return GLOBAL_LABEL_DEF; }
|
{GLOBAL_LABEL_WC} { yybegin(INSTRPART); yypushback(pushbackLabelColons(yytext())); return GLOBAL_LABEL_DEF; }
|
||||||
"macro" { yybegin(MACRODEF); return MACRO_TAG; }
|
// {MNEMONIC} { if(isAsmMnemonic(yytext())) { yybegin(ASMINSTR); return MNEMONIC; } else { yybegin(INSTRPART); return SYMBOL; } }
|
||||||
|
}
|
||||||
|
|
||||||
|
<NOSOL, INSTRPART>
|
||||||
|
{
|
||||||
{DIRECTIVE_KEYWORD} {
|
{DIRECTIVE_KEYWORD} {
|
||||||
if(isAsmMnemonicWithSize(yytext())) { yybegin(ASMINSTR); yypushback(2); return MNEMONIC; }
|
if(isAsmMnemonicWithSize(yytext())) { yybegin(ASMINSTR); yypushback(2); return MNEMONIC; }
|
||||||
if(isAsmMnemonic(yytext())) { yybegin(ASMINSTR); return MNEMONIC; }
|
if(isAsmMnemonic(yytext())) { yybegin(ASMINSTR); return MNEMONIC; }
|
||||||
if(isDataDirective(yytext())) { yybegin(EXPR); return DATA_DIRECTIVE; }
|
if(isDataDirective(yytext())) { startExpr(EXPR, EXPR_OP); return DATA_DIRECTIVE; }
|
||||||
if(isOtherDirective(yytext())) { yybegin(EXPR); return OTHER_DIRECTIVE; }
|
if(isOtherDirective(yytext())) { startExpr(EXPR, EXPR_OP); return OTHER_DIRECTIVE; }
|
||||||
return handleMacroMode(this);
|
return handleMacroMode(this);
|
||||||
}
|
}
|
||||||
// {MNEMONIC} { if(isAsmMnemonic(yytext())) { yybegin(ASMINSTR); return MNEMONIC; } else { yybegin(INSTRPART); return SYMBOL; } }
|
|
||||||
{MACRONAME} { return handleMacroMode(this); }
|
{MACRONAME} { return handleMacroMode(this); }
|
||||||
{HASH_COMMENT} { yybegin(YYINITIAL); return COMMENT; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<INSTRPART> {
|
<INSTRPART> {
|
||||||
{WHITE_SPACE} { return WHITE_SPACE; }
|
|
||||||
{EOL} { yybegin(YYINITIAL); return EOL; }
|
|
||||||
|
|
||||||
":" { return COLON; }
|
":" { return COLON; }
|
||||||
|
|
||||||
{DIRECTIVE_KEYWORD} {
|
|
||||||
if(isAsmMnemonicWithSize(yytext())) { yybegin(ASMINSTR); yypushback(2); return MNEMONIC; }
|
|
||||||
if(isAsmMnemonic(yytext())) { yybegin(ASMINSTR); return MNEMONIC; }
|
|
||||||
if(isDataDirective(yytext())) { yybegin(EXPR); return DATA_DIRECTIVE; }
|
|
||||||
if(isOtherDirective(yytext())) { yybegin(EXPR); return OTHER_DIRECTIVE; }
|
|
||||||
return handleMacroMode(this);
|
|
||||||
}
|
|
||||||
// {MNEMONIC} { if(isAsmMnemonic(yytext())) { yybegin(ASMINSTR); return MNEMONIC; } else { return SYMBOL; } }
|
// {MNEMONIC} { if(isAsmMnemonic(yytext())) { yybegin(ASMINSTR); return MNEMONIC; } else { return SYMBOL; } }
|
||||||
{MACRONAME} { return handleMacroMode(this); }
|
|
||||||
|
|
||||||
{COMMENT} { yybegin(WAITEOL); return COMMENT; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<ASMINSTR> {
|
<ASMINSTR> {
|
||||||
{WHITE_SPACE} { yybegin(ASMOPS); return WHITE_SPACE; }
|
{WHITE_SPACE} { startExpr(ASMOPS, ASMOPS_OP); return WHITE_SPACE; }
|
||||||
{EOL} { yybegin(YYINITIAL); return EOL; }
|
|
||||||
|
|
||||||
{OPSIZE_BS} { return OPSIZE_BS; }
|
{OPSIZE_BS} { return OPSIZE_BS; }
|
||||||
{OPSIZE_W} { return OPSIZE_W; }
|
{OPSIZE_W} { return OPSIZE_W; }
|
||||||
{OPSIZE_L} { return OPSIZE_L; }
|
{OPSIZE_L} { return OPSIZE_L; }
|
||||||
|
|
||||||
{COMMENT} { yybegin(WAITEOL); return COMMENT; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<MACROCALL> {
|
<MACROCALL> {
|
||||||
{WHITE_SPACE} { return handleEolCommentWhitespace(this); }
|
|
||||||
{EOL} { yybegin(YYINITIAL); return EOL; }
|
|
||||||
|
|
||||||
"," { return SEPARATOR; }
|
"," { return SEPARATOR; }
|
||||||
|
|
||||||
{COMMENT} { yybegin(WAITEOL); return COMMENT; }
|
|
||||||
|
|
||||||
{PLAINPARAM} { return STRINGLIT; }
|
{PLAINPARAM} { return STRINGLIT; }
|
||||||
}
|
}
|
||||||
|
|
||||||
<ASSIGNMENT> {
|
<ASSIGNMENT> {
|
||||||
{WHITE_SPACE} { return WHITE_SPACE; }
|
"equ"|"set" { startExpr(EXPR, EXPR_OP); return EQU; }
|
||||||
{EOL} { yybegin(YYINITIAL); return EOL; }
|
|
||||||
|
|
||||||
"equ"|"set" { yybegin(EXPR); return EQU; }
|
|
||||||
|
|
||||||
":" { return COLON; }
|
":" { return COLON; }
|
||||||
"=" { yybegin(EXPR); return OP_ASSIGN; }
|
"=" { startExpr(EXPR, EXPR_OP); return OP_ASSIGN; }
|
||||||
|
}
|
||||||
|
|
||||||
|
<EXPR, ASMOPS> {
|
||||||
|
{BINARY} { yybegin(exprOpState); return BINARY; }
|
||||||
|
{HEXADECIMAL} { yybegin(exprOpState); return HEXADECIMAL; }
|
||||||
|
{OCTAL} { yybegin(exprOpState); return OCTAL; }
|
||||||
|
{DECIMAL} { yybegin(exprOpState); return DECIMAL; }
|
||||||
|
{STRINGLIT} { yybegin(exprOpState); return STRINGLIT; }
|
||||||
|
|
||||||
|
"^" { return OP_BITWISE_XOR; }
|
||||||
|
"," { return SEPARATOR; }
|
||||||
|
"(" { return ROUND_L; }
|
||||||
|
")" { yybegin(exprOpState); return ROUND_R; }
|
||||||
|
"!" { return OP_UNARY_NOT; }
|
||||||
|
"~" { return OP_UNARY_COMPL; }
|
||||||
|
"+" { return OP_PLUS; }
|
||||||
|
"-" { return OP_MINUS; }
|
||||||
|
"*" { yybegin(exprOpState); return CURRENT_PC_SYMBOL; }
|
||||||
|
|
||||||
{COMMENT} { yybegin(WAITEOL); return COMMENT; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<EXPR> {
|
<EXPR> {
|
||||||
{WHITE_SPACE} { return handleEolCommentWhitespace(this); }
|
{BONUSSYMBOL} { yybegin(exprOpState); return SYMBOL; }
|
||||||
{EOL} { yybegin(YYINITIAL); return EOL; }
|
|
||||||
|
|
||||||
{BINARY} { yybegin(EXPR_OP); return BINARY; }
|
|
||||||
{HEXADECIMAL} { yybegin(EXPR_OP); return HEXADECIMAL; }
|
|
||||||
{OCTAL} { yybegin(EXPR_OP); return OCTAL; }
|
|
||||||
{DECIMAL} { yybegin(EXPR_OP); return DECIMAL; }
|
|
||||||
{STRINGLIT} { yybegin(EXPR_OP); return STRINGLIT; }
|
|
||||||
|
|
||||||
"^" { return OP_BITWISE_XOR; }
|
|
||||||
"," { return SEPARATOR; }
|
|
||||||
"(" { return ROUND_L; }
|
|
||||||
")" { yybegin(EXPR_OP); return ROUND_R; }
|
|
||||||
"!" { return OP_UNARY_NOT; }
|
|
||||||
"~" { return OP_UNARY_COMPL; }
|
|
||||||
"+" { return OP_PLUS; }
|
|
||||||
"-" { return OP_MINUS; }
|
|
||||||
"*" { yybegin(EXPR_OP); return CURRENT_PC_SYMBOL; }
|
|
||||||
|
|
||||||
{BONUSSYMBOL} { yybegin(EXPR_OP); return SYMBOL; }
|
|
||||||
|
|
||||||
{COMMENT} { yybegin(WAITEOL); return COMMENT; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<EXPR_OP> {
|
<EXPR_OP, ASMOPS_OP> {
|
||||||
{WHITE_SPACE} { return handleEolCommentWhitespace(this); }
|
"<<" { yybegin(exprState); return OP_AR_SHIFT_L; }
|
||||||
{EOL} { yybegin(YYINITIAL); return EOL; }
|
">>" { yybegin(exprState); return OP_AR_SHIFT_R; }
|
||||||
|
"&&" { yybegin(exprState); return OP_LOGICAL_AND; }
|
||||||
|
"||" { yybegin(exprState); return OP_LOGICAL_OR; }
|
||||||
|
"=="|"=" { yybegin(exprState); return OP_CMP_EQ; }
|
||||||
|
"<>"|"!=" { yybegin(exprState); return OP_CMP_NOT_EQ; }
|
||||||
|
">=" { yybegin(exprState); return OP_CMP_GT_EQ; }
|
||||||
|
"<=" { yybegin(exprState); return OP_CMP_LT_EQ; }
|
||||||
|
"<" { yybegin(exprState); return OP_CMP_LT; }
|
||||||
|
">" { yybegin(exprState); return OP_CMP_GT; }
|
||||||
|
"&" { yybegin(exprState); return OP_BITWISE_AND; }
|
||||||
|
"|"|"!" { yybegin(exprState); return OP_BITWISE_OR; }
|
||||||
|
"^" { yybegin(exprState); return OP_BITWISE_XOR; }
|
||||||
|
|
||||||
"<<" { 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_GT_EQ; }
|
|
||||||
"<=" { yybegin(EXPR); return OP_CMP_LT_EQ; }
|
|
||||||
"<" { yybegin(EXPR); return OP_CMP_LT; }
|
|
||||||
">" { yybegin(EXPR); return OP_CMP_GT; }
|
|
||||||
"&" { yybegin(EXPR); return OP_BITWISE_AND; }
|
|
||||||
"|"|"!" { yybegin(EXPR); return OP_BITWISE_OR; }
|
|
||||||
"^" { yybegin(EXPR); return OP_BITWISE_XOR; }
|
|
||||||
// ":" { return COLON; }
|
// ":" { return COLON; }
|
||||||
// ";" { return SEMICOLON; }
|
// ";" { return SEMICOLON; }
|
||||||
// "[" { return SQUARE_L; }
|
// "[" { return SQUARE_L; }
|
||||||
// "]" { return SQUARE_R; }
|
// "]" { return SQUARE_R; }
|
||||||
"," { yybegin(EXPR); return SEPARATOR; }
|
"," { yybegin(exprState); return SEPARATOR; }
|
||||||
"(" { yybegin(EXPR); return ROUND_L; }
|
"(" { yybegin(exprState); return ROUND_L; }
|
||||||
")" { return ROUND_R; }
|
")" { return ROUND_R; }
|
||||||
// "." { return DOT; }
|
// "." { return DOT; }
|
||||||
// "$" { return DOLLAR; }
|
// "$" { return DOLLAR; }
|
||||||
"~" { yybegin(EXPR); return OP_UNARY_COMPL; }
|
"~" { yybegin(exprState); return OP_UNARY_COMPL; }
|
||||||
"+" { yybegin(EXPR); return OP_PLUS; }
|
"+" { yybegin(exprState); return OP_PLUS; }
|
||||||
"-" { yybegin(EXPR); return OP_MINUS; }
|
"-" { yybegin(exprState); return OP_MINUS; }
|
||||||
"*" { yybegin(EXPR); return OP_AR_MUL; }
|
"*" { yybegin(exprState); return OP_AR_MUL; }
|
||||||
"%"|"//" { yybegin(EXPR); return OP_AR_MOD; }
|
"%"|"//" { yybegin(exprState); return OP_AR_MOD; }
|
||||||
"/" { yybegin(EXPR); return OP_AR_DIV; }
|
"/" { yybegin(exprState); return OP_AR_DIV; }
|
||||||
|
|
||||||
{COMMENT} { yybegin(WAITEOL); return COMMENT; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<ASMOPS> {
|
<ASMOPS> {
|
||||||
{WHITE_SPACE} { return handleEolCommentWhitespace(this); }
|
{AREG} { yybegin(exprOpState); return AREG; }
|
||||||
{EOL} { yybegin(YYINITIAL); return EOL; }
|
{DREG} { yybegin(exprOpState); return DREG; }
|
||||||
|
"sp"|"a7" { yybegin(exprOpState); return REG_SP; }
|
||||||
{BINARY} { yybegin(ASMOPS_OP); return BINARY; }
|
"pc" { yybegin(exprOpState); return PC; }
|
||||||
{HEXADECIMAL} { yybegin(ASMOPS_OP); return HEXADECIMAL; }
|
"ccr" { yybegin(exprOpState); return REG_CCR; }
|
||||||
{OCTAL} { yybegin(ASMOPS_OP); return OCTAL; }
|
"sr" { yybegin(exprOpState); return REG_SR; }
|
||||||
{DECIMAL} { yybegin(ASMOPS_OP); return DECIMAL; }
|
"usp" { yybegin(exprOpState); return REG_USP; }
|
||||||
{STRINGLIT} { yybegin(ASMOPS_OP); return STRINGLIT; }
|
"vbr" { yybegin(exprOpState); return REG_VBR; }
|
||||||
|
|
||||||
{AREG} { yybegin(ASMOPS_OP); return AREG; }
|
|
||||||
{DREG} { yybegin(ASMOPS_OP); return DREG; }
|
|
||||||
"sp"|"a7" { yybegin(ASMOPS_OP); return REG_SP; }
|
|
||||||
"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; }
|
"#" { return HASH; }
|
||||||
|
|
||||||
{SYMBOL} { yybegin(ASMOPS_OP); return SYMBOL; }
|
{SYMBOL} { yybegin(exprOpState); return SYMBOL; }
|
||||||
|
|
||||||
{COMMENT} { yybegin(WAITEOL); return COMMENT; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<ASMOPS_OP> {
|
<ASMOPS_OP> {
|
||||||
{WHITE_SPACE} { return handleEolCommentWhitespace(this); }
|
|
||||||
{EOL} { yybegin(YYINITIAL); return EOL; }
|
|
||||||
|
|
||||||
{OPSIZE_BS} { return OPSIZE_BS; }
|
{OPSIZE_BS} { return OPSIZE_BS; }
|
||||||
{OPSIZE_W} { return OPSIZE_W; }
|
{OPSIZE_W} { return OPSIZE_W; }
|
||||||
{OPSIZE_L} { return OPSIZE_L; }
|
{OPSIZE_L} { return OPSIZE_L; }
|
||||||
|
|
||||||
"<<" { 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; }
|
|
||||||
"," { yybegin(ASMOPS); return SEPARATOR; }
|
|
||||||
"(" { yybegin(ASMOPS); return ROUND_L; }
|
|
||||||
")" { return ROUND_R; }
|
|
||||||
// "." { return DOT; }
|
|
||||||
// "$" { return DOLLAR; }
|
|
||||||
"~" { 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; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<WAITEOL>
|
<WAITEOL>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user