works from processing to arduino but not other way

I've used this method to send X & Y angles for servos from processing to the arduino over a serial connection. However, when I try to send XY angles calculated from an accelerometer to processing from the arduino I can't get it to work. I know I need to use things like "myPort.read();" on processing instead of "Serial.read();" on arduino. I changed those, but still can't get processing code to compile.

I want to: Send data from arduino "Serial.write(xAngle+'x');" And have processing get the incoming numbers and if they're followed either an 'x' or a 'y' act accordingly. Here's the code that works on arduino but not processing:

void loop() {

  static int v = 0;

  if ( Serial.available()) {
    char ch = Serial.read();

    switch(ch) {
      case '0'...'9':
        v = v * 10 + ch - '0';
        break;
      case 'x':
        servoX.write(v); //instead of servoX.write() say "xAngle = v;"
        v = 0;
        break;
      case 'y':
        servoY.write(v); //instead of servoY.write() say "yAngle = v;"
        v = 0;
        break;
    }
  } 
}

The first issue is that the keyword "static" isn't allowed for some reason. Second issue it that "case '0'...'9':" won't compile. There are more issues but I'd just like to get moving in the right direction here. Any advice would be appreciated. Thanks in advance.

If you define v outside the main loop it is static.

The case should be

case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
        v = v * 10 + ch - '0';
        break;

The first issue is that the keyword "static" isn't allowed

That hasn't been my experience - can you explain some more, or post your whole sketch?