by inaki » Fri Jun 09, 2006 5:00 pm
by inaki
Fri Jun 09, 2006 5:00 pm
My tokenizer, that I call Biotoken, is about to be released, but I would like to hear about any features you would like to include before release.
The tokenizer supports every sentence included in the original BCP:
START
END
LOAD
CALL
RETURN
JUMP
IF
ELSE
ELSE_IF
CONT_IF
COMPUTE
plus the following:
- Comments
- Constants
- The ability to include libraries
- FOR/NEXT Sentence
- REPEAT/UNTIL Sentence
- WHILE/WEND Sentence
You can write the source code with any editor. The tokenizer is a console mode program. You pass the file to compile as an argument and then the tokenizer generates the code, connects to your robot and transmits the file (an average program takes a few seconds to compile and transmit). An option allows to see the strings generated with the Print sentence.
I am able to write programs for Biotoken about 10 times faster than using BCP. Programs are easier to read and easier to maintain and fix. The only iconvenient is that it is easier to have an error because you edit freely your code text.
The tokenizer is case 'insensitive'. You may write LOAD, load, Load or wathever and it is all the same. The same applies to constants, labels and variables.
All registers covered by BCP have names under Biotoken that you can use to refer to almost any register in CM5, AX or AX-S1 devices. You can define your own constants or use the numerical values instead.
Here is an example of how Biotoken code looks:
//This is an example program for listening the FX sounds in AX-S1
START
//Main Loop
FOR MUSIC = 0 TO 27
LOAD AX.100.BUZZER_VAL, 255
LOAD AX.100.BUZZER_INDEX, MUSIC
CALL DELAY
NEXT MUSIC
JUMP Exit
//Generic Delay
DELAY:
LOAD CM5.TIMER, 20
DELAY1:
IF CM5.TIMER > 0 THEN JUMP DELAY1
RETURN
Exit:
END
Please add your comments and the features you would like to see, before I release the first version.
My tokenizer, that I call Biotoken, is about to be released, but I would like to hear about any features you would like to include before release.
The tokenizer supports every sentence included in the original BCP:
START
END
LOAD
CALL
RETURN
JUMP
IF
ELSE
ELSE_IF
CONT_IF
COMPUTE
plus the following:
- Comments
- Constants
- The ability to include libraries
- FOR/NEXT Sentence
- REPEAT/UNTIL Sentence
- WHILE/WEND Sentence
You can write the source code with any editor. The tokenizer is a console mode program. You pass the file to compile as an argument and then the tokenizer generates the code, connects to your robot and transmits the file (an average program takes a few seconds to compile and transmit). An option allows to see the strings generated with the Print sentence.
I am able to write programs for Biotoken about 10 times faster than using BCP. Programs are easier to read and easier to maintain and fix. The only iconvenient is that it is easier to have an error because you edit freely your code text.
The tokenizer is case 'insensitive'. You may write LOAD, load, Load or wathever and it is all the same. The same applies to constants, labels and variables.
All registers covered by BCP have names under Biotoken that you can use to refer to almost any register in CM5, AX or AX-S1 devices. You can define your own constants or use the numerical values instead.
Here is an example of how Biotoken code looks:
//This is an example program for listening the FX sounds in AX-S1
START
//Main Loop
FOR MUSIC = 0 TO 27
LOAD AX.100.BUZZER_VAL, 255
LOAD AX.100.BUZZER_INDEX, MUSIC
CALL DELAY
NEXT MUSIC
JUMP Exit
//Generic Delay
DELAY:
LOAD CM5.TIMER, 20
DELAY1:
IF CM5.TIMER > 0 THEN JUMP DELAY1
RETURN
Exit:
END
Please add your comments and the features you would like to see, before I release the first version.