YACAL2: CASL2処理系
[YACASL2.git] / test / utest / opdtok / opdtok.c
1 #include "casl2.h"
2 #include "assemble.h"
3
4 int main(){
5     int i, j;
6     OPD *opd;
7     char *str[] = {
8         "", "GR0,GR1", "GR0,A", "GR1,12", "GR0,0,GR1",
9         "\'aaa\',0", "\'aaa\',\'bbb\'", "\'aaa\'\',\'\'bbb\'", "\'aaa,bbb\'",
10         "0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9",
11         "0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0",
12         "\'01234567890123456789012345678901234567\'",
13         "\'012345678901234567890123456789012345678\'"
14     };
15     for(i = 0; i < sizeof str / sizeof str[0]; i++) {
16         printf("%s\n", str[i]);
17         opd = opdtok(str[i]);
18         printf("OPDC:%d\n", opd->opdc);
19         for(j = 0; j < opd->opdc; j++) {
20             printf("OPDC[%d]:%s\n", j, opd->opdv[j]);
21         }
22         if(cerrno > 0){
23             printf("Error - %d: %s\n", cerrno, cerrmsg);
24             freecerr();
25         }
26         printf("\n");        
27     }
28     return 0;
29 }