Check your indentation.
This flavour of C++ doesn't allow function declarations inside other functions.
You aren't supposed to check your indentation, more re-do it so you can read your own code easier.
Maybe you are unsure because they are macros, but ISR(){ //... } is a function definition and must go at file scope like loop(), rather than in loop() itself ( nested ).
//Should not be declared inside a function
ISR(TIMER2_OVF_vect) {
PORTD=(sinetable[j++]);
TCNT2=455;
if(j==32){
j=0;
}
}