正在加载图片...
China-pub.com 第4章自顶向下的分析 109 下载 的C代码。其中并未写出一个完整的扫描程序,而是选择使用了对getchar和scanf的调用来 代替getToken的过程。 程序清单41简单整型算术的递归下降程序计算器 kexp>-sterm>caddop>stern> caddop>->+1- m>-cfactor>cmulop>(factor> cfactor>->(cexp>I Mumber rmputs a line of text from stdin inatadoh char token;/*global token variable/ int term(void) int factor(void) void●rrox(vo1d) Eprintf(stderr,"Error\n"): 0x1t(1) token getchar();/*load token with first character for lookahead/ t for ond of line/ printf("Result din",result) ()trameou chare on line int exp(void) 【1 nt tempterm(i (token)( ae◆:atch+: 的C代码。其中并未写出一个完整的扫描程序,而是选择使用了对 g e t c h a r和s c a n f的调用来 代替g e t T o k e n的过程。 程序清单4-1 简单整型算术的递归下降程序计算器 第 4章 自顶向下的分析 1 0 9 下载
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有