Simplify GTToken

This commit is contained in:
Clément Fournier
2019-07-21 23:43:35 +02:00
parent 1cebd1d59e
commit 0ce6234ba7
2 changed files with 9 additions and 9 deletions

View File

@ -2999,19 +2999,15 @@ void AssertStatement() :
void RUNSIGNEDSHIFT() #void:
{}
{
( LOOKAHEAD({ getToken(1).kind == GT &&
((JavaTokenUtils.GTToken)getToken(1)).realKind == RUNSIGNEDSHIFT} )
">" ">" ">"
)
LOOKAHEAD({ JavaTokenUtils.getRealKind(getToken(1)) == RUNSIGNEDSHIFT})
">" ">" ">"
}
void RSIGNEDSHIFT() #void:
{}
{
( LOOKAHEAD({ getToken(1).kind == GT &&
((JavaTokenUtils.GTToken)getToken(1)).realKind == RSIGNEDSHIFT} )
">" ">"
)
LOOKAHEAD({ JavaTokenUtils.getRealKind(getToken(1)) == RSIGNEDSHIFT})
">" ">"
}
/* Annotation syntax follows. */

View File

@ -43,7 +43,11 @@ final class JavaTokenUtils {
}
}
static final class GTToken extends JavaccToken {
static int getRealKind(JavaccToken token) {
return token instanceof GTToken ? ((GTToken) token).realKind : token.kind;
}
private static final class GTToken extends JavaccToken {
final int realKind;