reportErrorForToken(ParserErrorCode.EXTERNAL_FIELD, modifiers.getExternalKeyword());
}
if (modifiers.getFactoryKeyword() != null) {
reportErrorForToken(ParserErrorCode.NON_CONSTRUCTOR_FACTORY, modifiers.getFactoryKeyword());
}
Token staticKeyword = modifiers.getStaticKeyword();
Token constKeyword = modifiers.getConstKeyword();
Token finalKeyword = modifiers.getFinalKeyword();
Token varKeyword = modifiers.getVarKeyword();
if (constKeyword != null) {
if (finalKeyword != null) {
reportErrorForToken(ParserErrorCode.CONST_AND_FINAL, finalKeyword);
}
if (varKeyword != null) {
reportErrorForToken(ParserErrorCode.CONST_AND_VAR, varKeyword);
}
if (staticKeyword != null && constKeyword.getOffset() < staticKeyword.getOffset()) {
reportErrorForToken(ParserErrorCode.STATIC_AFTER_CONST, staticKeyword);
}
} else if (finalKeyword != null) {
if (varKeyword != null) {
reportErrorForToken(ParserErrorCode.FINAL_AND_VAR, varKeyword);
}
if (staticKeyword != null && finalKeyword.getOffset() < staticKeyword.getOffset()) {
reportErrorForToken(ParserErrorCode.STATIC_AFTER_FINAL, staticKeyword);
}
} else if (varKeyword != null && staticKeyword != null
&& varKeyword.getOffset() < staticKeyword.getOffset()) {
reportErrorForToken(ParserErrorCode.STATIC_AFTER_VAR, staticKeyword);
}
return lexicallyFirst(constKeyword, finalKeyword, varKeyword);
}