File: [local] / OpenXM / src / kan96xx / Kan / mklookup.c (download)
Revision 1.7, Thu Sep 8 10:49:30 2022 UTC (2 years ago) by takayama
Branch: MAIN
CVS Tags: HEAD Changes since 1.6: +5 -1
lines
cmotag.htmp, lookup.h are generated by
make gen-cmptag.htmp
make gen-lookup.h
(They are not automatic).
The change is for the cross compiling.
|
/* $OpenXM: OpenXM/src/kan96xx/Kan/mklookup.c,v 1.7 2022/09/08 10:49:30 takayama Exp $ */
/*
If you add new names, update lookup.h by
make gen-lookup.h
*/
#include <stdio.h>
#include <stdlib.h>
#include "datatype.h"
#include "stackm.h"
/* Refer to global.c. You need to keep the orders of names and values */
int main() {
int i,j;
char *names[]={"Snull","Sinteger","Sstring","SexecutableArray","Soperator",
"Sdollar","Sarray","SleftBraceTag","SrightBraceTag","Spoly",
"SarrayOfPOLY","SmatrixOfPOLY","Slist","Sfile","Sring",
"SuniversalNumber","SrationalFunction","Sclass","Sdouble",
"SbyteArray"};
int values[]={Snull,Sinteger,Sstring,SexecutableArray,Soperator,
Sdollar,Sarray,SleftBraceTag,SrightBraceTag,Spoly,
SarrayOfPOLY,SmatrixOfPOLY,Slist,Sfile,Sring,
SuniversalNumber,SrationalFunction,Sclass,Sdouble,
SbyteArray};
for (i=0; i<TYPES; i++) {
if (values[i] != i) {
fprintf(stderr,"Errors in names and values\n");
return 100;
}
for (j=0; j<TYPES; j++) {
printf("#define %s%s %d\n",names[i],names[j],values[i]*TYPES+values[j]);
}
}
return 0;
}