clex_test.c
资源名称:parse.tar.Z [点击查看]
上传用户:hbdengju
上传日期:2007-01-06
资源大小:11k
文件大小:1k
源码类别:
编译器/解释器
开发平台:
C/C++
- // clex_test -- test code for clex.o
- #include "clex.h"
- main()
- {
- Clex cl = Clex(stdin, TRUE);
- Clex_sym s;
- do {
- s = cl.next();
- printf("%5D ", cl.line_no());
- if (s >= KEYWORD_S)
- printf(" %sn", cl.debug(s));
- else if (s == IDENT_S ||
- s == NUM_S ||
- s == FLOATNUM_S ||
- s == LBRACK_S ||
- s == APOS_S ||
- s == QUOTE_S )
- printf( " %s "%s"n", cl.debug(s), cl.str());
- else
- printf( " %sn", cl.debug(s));
- } while (s > EOF_S);
- exit(0);
- }