Unexpected Token Error

So I'm trying to upload this demo sketch to my Arduino Uno R3 to simulate a mouse driver that I found here: http://hunt.net.nz/users/darran/weblog/cca39/Arduino_UNO_Mouse_HID.html

Originally, I was able to upload the sketch just fine, and flashed it to imitate a USB Mouse Driver and the program ran just fine (meaning the mouse cursor was moving in a square pattern). I wanted to slightly tweak the code to possibly make it move in a slightly bigger square pattern so I flashed it back to the original firmware. Now, after updating the code, I'm getting this error called "unexpected token: struct" whenever I attempt to compile it. I have no idea what I did wrong since I'm using the same software as before, and the board runs the blink program just fine when I test the board.

/* Arduino USB Mouse HID demo */

/* Author: Darran Hunt
 * Release into the public domain.
 */

struct {
    uint8_t buttons;
    int8_t x;
    int8_t y;
    int8_t wheel;	/* Not yet implemented */
} mouseReport;

uint8_t nullReport[4] = { 0, 0, 0, 0 };

void setup();
void loop();

void setup() 
{
    Serial.begin(9600);
    delay(200);
}

/* Move the mouse in a clockwise square every 5 seconds */
void loop() 
{
    int ind;
    delay(5000);

    mouseReport.buttons = 0;
    mouseReport.x = 0;
    mouseReport.y = 0;
    mouseReport.wheel = 0;

    mouseReport.x = -5;
    for (ind=0; ind<20; ind++) {
	Serial.write((uint8_t *)&mouseReport, 4);
	Serial.write((uint8_t *)&nullReport, 4);
    }

    mouseReport.x = 0;
    mouseReport.y = -5;
    for (ind=0; ind<20; ind++) {
	Serial.write((uint8_t *)&mouseReport, 4);
	Serial.write((uint8_t *)&nullReport, 4);
    }

    mouseReport.x = 5;
    mouseReport.y = 0;
    for (ind=0; ind<20; ind++) {
	Serial.write((uint8_t *)&mouseReport, 4);
	Serial.write((uint8_t *)&nullReport, 4);
    }

    mouseReport.x = 0;
    mouseReport.y = 5;
    for (ind=0; ind<20; ind++) {
	Serial.write((uint8_t *)&mouseReport, 4);
	Serial.write((uint8_t *)&nullReport, 4);
    }
}

The only error I get when I attempt to compile is "unexpected token: struct" and it highlights the struct function. No other detail is shown.

I read somewhere that the update to the software may have caused an error to old programs, but since I was able to run this just fine at my first attempt without an issues using processing-2.0b6, I don't think it's the software. I assume I probably uploaded the wrong firmware but under device manager, it reads as Arduino Uno R3, so I'm a bit stumped at the moment. Any help and/or guidance would be appriaciated, thanks!

What version of the IDE are you using? I compiled that, after fixing the setup() and loop() functions to actually have bodies, with no errors.

I originally used Processing Application 2.0b6 32 bit, and also tried it on Processing Application 2.0b7 64 bit. So it was an issue with the sketch? I don't get why though, I didn't change anything besides the x and y value to move the mouse. I also redownloaded the sketch from the link posted in the original post and it gave the same error. I wonder if I did something different the first time around...

Edit: Hold on, even though it doesn't compile using Processing Application, it compiles using the original Arduino Software, I'm going to test it right now.

That's not a Processing sketch. Why are you trying to compile it with Processing?

If it was a Processing sketch, it would have setup() and draw(), not setup() and loop().

It was saved as a processing file extension and opened using the processing software, so I naturally assumed it was for the processing software. Maybe I had my file associations mixed up, but it seems to work now using the Arduino IDE. Either way, thanks! Your post got me thinking about the actual software being the issue since you ran out without asking about the software itself.

Prior to 1.0, Arduino and Processing used the same extension, .pde. Starting with 1.0, the Arduino extension was (finally!) changed to .ino. I'm guessing that the last time you dealt with the application it was on a pre-1.0 version of the Arduino IDE.