编译原理(第版)陈意云+张昱编著课后答案.ppt

编译原理(第版)陈意云+张昱编著课后答案.ppt

编译原理习题 2003.4 目录 chap 1 基本知识 chap 3 词法分析 chap 4 语法分析 chap 5 语法制导翻译 chap 6 运行时刻环境 chap 7 中间代码生成 chap 8 代码生成 (b) S ? E{S.type = E.type; S.code = E.code;}E ? E1+T{if ( E1.t ype = real and T.type = integer ) thenbegin E.type = real;E.code = ‘+’ || E1 .code || inttoreal(T.code)endelse if ( E1.t ype = integer and T.type = real ) thenbegin E.type = real;E.code = ‘+’ || inttoreal(E1 .code) || T.codeendelse begin E.type = E1.t ype;E.code = ‘+’ || E1 .code || T.codeend}E ? T{ E.type = T.type ; E.code = T.code}T ? num.num { T.type = real; T.code = (num.num).lexval}T ? num{T.type = integer;

文档评论(0)

1亿VIP精品文档

相关文档