语义处理 语义处理的环境:符号表 为语义分析提供类型、作用域等信息。 为代码生成提供类型、作用域、存储类别、 存储(相对)位置等信息
语义处理 语义处理的环境:符号表 • 为语义分析提供类型、作用域等信息。 • 为代码生成提供类型、作用域、存储类别、 存储(相对)位置等信息
语义处理 PL/编译程序的语义处理(一)cal语句的处理 if sym callsym then begin getsym; if sym < ident then error(14) else begin i: position(id) if i=0 then error(11) else with table[] do if kind procedur then gen(cal, lev-level, adr) else error (15); getsym end nd
语义处理 if sym = callsym then begin getsym; if sym <> identthen error(14) else begin i := position(id); if i = 0 then error(11) else with table[i] do if kind = procedur then gen(cal, lev-level, adr) else error(15); getsym end end PL/0编译程序的语义处理(一)call语句的处理