public static boolean identifier_ref(PsiBuilder b, int level) {
IElementType type = b.getTokenType();
if (CueTokenTypes.IDENTIFIERS.contains(type)) {
b.advanceLexer();
return true;
}
// null is a NULL_LIT, true and false are BOOL_LIT, all others are KEYWORD, so we can just remap KEYWORD
if (type == CueTypes.KEYWORD) {
b.remapCurrentToken(CueTypes.IDENTIFIER);
b.advanceLexer();
return true;
}
return false;
}
It is used for transforming KEYWORD to IDENTIFIER in an OperandName.
I want to replace the <> by comb_identifier, so I can resolve the reference of comb_identifier in an OperandName. But if I do so, KEYWORD cannot be remapped as IDENTIFIER. What can I do to achieve my purpose?
In my .bnf file, I define some rules as follow:
The code of external rule <> is
It is used for transforming KEYWORD to IDENTIFIER in an OperandName. I want to replace the <> by comb_identifier, so I can resolve the reference of comb_identifier in an OperandName. But if I do so, KEYWORD cannot be remapped as IDENTIFIER. What can I do to achieve my purpose?