作者huiming (寂寞在唱歌)
看板Programming
标题[问题] 关於compiler的语汇分析(lexical analysis)
时间Fri Mar 12 09:55:17 2010
compiler的
语汇分析(lexical analysis)、
语法分析(syntax analusis)、
语意分析(semantic analysis)
这三个阶段以前学校老师说是平台独立
不过最近在网路看到某投影片写
"关於将语汇分析语语法分析分开的理由"有三点:
Simplicity (简单)
Less complex approaches can be used for lexical analysis; separating them
simplifies the parser
Efficiency (效率)
Separation allows optimization of the lexical analyzer
Portability (可携)
Parts of the lexical analyzer is somewhat platform-dependent, but
the syntax analyzer can be platform-independent (平台独立)
在可携性那像写说lexical analyzer有时跟平台有关,
这样compiler不就跟平台也有关了吗?
有点困惑? 希望有人可以给我点意见, 谢谢!
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.27.36.153
※ huiming:转录至看板 C_and_CPP 03/12 09:58