File: [local] / OpenXM / src / kan96xx / trans / yymain_polymake.c (download)
Revision 1.3, Thu Apr 8 01:49:04 2004 UTC (20 years, 5 months ago) by takayama
Branch: MAIN
Changes since 1.2: +3 -1
lines
BUG:
if the input starts with an empty line like
_test
# comment
POINTS
1 2
1 0
1 1
it caused a parse error.
The bug is fixed.
|
/* $OpenXM: OpenXM/src/kan96xx/trans/yymain_polymake.c,v 1.3 2004/04/08 01:49:04 takayama Exp $ */
#include <stdio.h>
#include "yylex_polymake.h"
#include "yy_polymake.tab.h"
char *SS=NULL;
main_t() {
int c,type;
pmPutstr(-1);
while ((c=getchar()) != EOF) {
pmPutstr(c);
}
pmPutstr('\n');
SS = pmPutstr(0);
printf("%s\n",SS);
pmSetS(SS);
pmPreprocess();
printf("--------------------------\n");
printf("%s\n",SS);
printf("--------------------------\n");
while ((type=PMlex()) != PM_noToken) {
printf("type=%d ",type);
if ((type == PM_number) || (type == PM_keyword)) {
printf("value="); pmPrintObject(stdout,PMlval);
}
printf("\n");
}
}
main() {
int c,type;
pmPutstr(-1);
while ((c=getchar()) != EOF) {
pmPutstr(c);
}
pmPutstr('\n');
SS = pmPutstr(0);
#ifdef DEBUG
printf("%s\n",SS);
#endif
pmSetS(SS);
pmPreprocess();
#ifdef DEBUG
printf("--------------------------\n");
printf("%s\n",SS);
printf("--------------------------\n");
#endif
PMparse();
}
sGC_malloc(int n) {
return GC_malloc(n);
}
PMerror() {
}