正在加载图片...
Syntax-Directed Translation Grammar symbols are associated with attributes to associate information with the programming language constructs that they represent. Values of these attributes are evaluated by the semantic rules associated with the production rules. Evaluation of these semantic rules: -may generate intermediate codes may put information into the symbol table may perform type checking may issue error messages may perform some other activities -in fact,they may perform almost any activities. An attribute may hold almost any thing. a string,a number,a memory location,a complex record. CS308 Compiler Theory 2Syntax-Directed Translation • Grammar symbols are associated with attributes to associate information ith the programming lang age constr cts that the information with the programming lang uage constructs that they represent. • Values of these attributes are evaluated by the Values of these attributes are evaluated by the semantic rules semantic rules associated with the production rules. • Evaluation of these semantic rules: – may generate intermediate codes – may put information into the symbol table – ma y p yp g erform type checkin g – may issue error messages – may perform some other activities – in fact, they may perform almost any activities. ivities. • An attribute may hold almost any thing. – a string, a number, a memory location, a complex record. CS308 Compiler Theory 2
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有