Annotation of OpenXM/src/kan96xx/trans/yymain_polymake.c, Revision 1.8
1.8 ! noro 1: /* $OpenXM: OpenXM/src/kan96xx/trans/yymain_polymake.c,v 1.7 2020/10/06 11:33:48 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.8 ! noro 32: int PMparse();
! 33:
1.7 takayama 34: int main() {
1.1 takayama 35: int c,type;
1.5 takayama 36: GC_INIT();
1.1 takayama 37: pmPutstr(-1);
38: while ((c=getchar()) != EOF) {
39: pmPutstr(c);
40: }
1.3 takayama 41: pmPutstr('\n');
1.1 takayama 42: SS = pmPutstr(0);
1.2 takayama 43: #ifdef DEBUG
1.1 takayama 44: printf("%s\n",SS);
1.2 takayama 45: #endif
1.1 takayama 46: pmSetS(SS);
47: pmPreprocess();
1.2 takayama 48: #ifdef DEBUG
1.1 takayama 49: printf("--------------------------\n");
50: printf("%s\n",SS);
51: printf("--------------------------\n");
1.2 takayama 52: #endif
1.1 takayama 53: PMparse();
1.7 takayama 54: return 0;
1.1 takayama 55: }
56:
1.5 takayama 57: void *sGC_malloc(int n) {
1.1 takayama 58: return GC_malloc(n);
59: }
60:
1.6 takayama 61: void PMerror() {
1.4 takayama 62: fprintf(stderr,"Parse error. cf. yylex_polymake.c: PM_debug=1;\n");
1.1 takayama 63: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>