private boolean tokenTypesMatch ( Token token1 , Token token2 , Class < ? extends Token > tokenType ) { return tokenType . isAssignableFrom ( token1 . getClass ( ) ) && tokenType . isAssignableFrom ( token2 . getClass ( ) ) ; }
Checks whether both tokens have the specified type .