[BACK]Return to yymain_polymake.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / kan96xx / trans

Annotation of OpenXM/src/kan96xx/trans/yymain_polymake.c, Revision 1.7

1.7     ! takayama    1: /* $OpenXM: OpenXM/src/kan96xx/trans/yymain_polymake.c,v 1.6 2018/05/03 13:20:35 takayama Exp $ */
1.1       takayama    2: #include <stdio.h>
                      3: #include "yylex_polymake.h"
                      4: #include "yy_polymake.tab.h"
                      5:
1.2       takayama    6:
1.1       takayama    7: char *SS=NULL;
1.7     ! takayama    8: int main_t() {
1.1       takayama    9:   int c,type;
                     10:   pmPutstr(-1);
                     11:   while ((c=getchar()) != EOF) {
                     12:        pmPutstr(c);
                     13:   }
1.3       takayama   14:   pmPutstr('\n');
1.1       takayama   15:   SS = pmPutstr(0);
                     16:   printf("%s\n",SS);
                     17:   pmSetS(SS);
                     18:   pmPreprocess();
                     19:   printf("--------------------------\n");
                     20:   printf("%s\n",SS);
                     21:   printf("--------------------------\n");
                     22:   while ((type=PMlex()) != PM_noToken) {
                     23:        printf("type=%d ",type);
                     24:        if ((type == PM_number) || (type == PM_keyword)) {
                     25:          printf("value="); pmPrintObject(stdout,PMlval);
                     26:        }
                     27:        printf("\n");
                     28:   }
1.7     ! takayama   29:   return 0;
1.1       takayama   30: }
                     31:
1.7     ! takayama   32: int main() {
1.1       takayama   33:   int c,type;
1.5       takayama   34:   GC_INIT();
1.1       takayama   35:   pmPutstr(-1);
                     36:   while ((c=getchar()) != EOF) {
                     37:        pmPutstr(c);
                     38:   }
1.3       takayama   39:   pmPutstr('\n');
1.1       takayama   40:   SS = pmPutstr(0);
1.2       takayama   41: #ifdef DEBUG
1.1       takayama   42:   printf("%s\n",SS);
1.2       takayama   43: #endif
1.1       takayama   44:   pmSetS(SS);
                     45:   pmPreprocess();
1.2       takayama   46: #ifdef DEBUG
1.1       takayama   47:   printf("--------------------------\n");
                     48:   printf("%s\n",SS);
                     49:   printf("--------------------------\n");
1.2       takayama   50: #endif
1.1       takayama   51:   PMparse();
1.7     ! takayama   52:   return 0;
1.1       takayama   53: }
                     54:
1.5       takayama   55: void *sGC_malloc(int n) {
1.1       takayama   56:   return GC_malloc(n);
                     57: }
                     58:
1.6       takayama   59: void PMerror() {
1.4       takayama   60:   fprintf(stderr,"Parse error. cf. yylex_polymake.c: PM_debug=1;\n");
1.1       takayama   61: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>