error: Excessive token sequence

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
jb007
Active Member
Posts: 33
Joined: Fri Jul 23, 2010 5:10 am

error: Excessive token sequence

Post by jb007 »

Hi all. I've recently upgrade my OSX to version 10.8 (Mountain Lion), and have done a clean install of XDE Version: 11.11.0 (build 2237) .

Trying to build this simple piece of code:

Code: Select all

/*
 ============================================================================
 Name        : xc1a-led.xc
 Description : Illuminate an LED on the XC-1A board
 ============================================================================
 */

#include <platform.h>

out port bled = PORT_BUTTONLED;
int main() {
  bled <: 0b0001;
  while(1);
  return 0;
}
I get the following errors:

Code: Select all

**** Build of configuration Debug for project illuminate ****

xmake CONFIG=Debug all 
Creating dependencies for illuminate.xc
../src/illuminate.xc:1: error: Excessive token sequence "out port bled = PORT_BUTTONLED; int main() { bled <: 0b0001; while(1) ; return 0; }"
Updating eclipse config
     #include <platform.h> out port bled = PORT_BUTTONLED; int main() { bled <: 0b0001; while(1) ; return 0; }
1 error in preprocessor.
Using modules:
Compiling illuminate.xc
../src/illuminate.xc:1: error: Excessive token sequence "out port bled = PORT_BUTTONLED; int main() { bled <: 0b0001; while(1) ; return 0; }"
     #include <platform.h> out port bled = PORT_BUTTONLED; int main() { bled <: 0b0001; while(1) ; return 0; }
1 error in preprocessor.
xmake[1]: *** [.build_Debug/src/illuminate.xc.o] Error 1
xmake: *** [bin/Debug/illuminate_Debug.xe] Error 2
Java is:

Code: Select all

Fred:~ jb$ java -version
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-11M3720)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode)
Fred:~ jb$
I'm hoping it's something really simple that I'm doing wrong. Can anyone enlighten me?

TIA
Jim


User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

Post by Bianco »

What happens if you change 0b0001 to 0x01 or just 1?
The problem lays in the preprocessor, it could be that it chokes on the binary formatted value although i have no problem here using it in a small test on the command line (didn't even know it was supported).
User avatar
jb007
Active Member
Posts: 33
Joined: Fri Jul 23, 2010 5:10 am

Post by jb007 »

Bianco wrote:What happens if you change 0b0001 to 0x01 or just 1?
The problem lays in the preprocessor, it could be that it chokes on the binary formatted value although i have no problem here using it in a small test on the command line (didn't even know it was supported).
Thanks for your reply. I've tried as you have suggested, but no difference. I found out by accident that when I copied the code (copy to paste buffer) from my Hackintosh via screen sharing, and then pasting into a XDE session on my MacBook Air, that all of the code turned into "chinese' characters! So then I pasted into a text editor, cut it, then re-pasted bak into the XDE IDE. Bingo, compiled OK (well PORT_BUTTONLED wasn't defined, but thats another story).

Thanks, Jim.