正在加载图片...
Translation Schemes In a syntax-directed definition,we do not say anything about the evaluation times of the semantic rules (when the semantic rules associated with a production should be evaluated?). .A translation scheme is a context-free grammar in which: -attributes are associated with the grammar symbols and semantic actions enclosed between braces are inserted within the right sides of productions. ·Ex: A→{}X{…}Y{…} Semantic Actions CS308 Compiler Theory 6Translation Schemes • In a syntax-directed definition, we do not say anything about the eval i i fh i l ( h h i l luat ion t imes o f t he semant ic ru les ( w hen t he semant ic ru les associated with a production should be evaluated?). • A translation scheme is a context-free grammar in which: – att ib t i t d ith th b l d tt rib u tes are assoc i a t e d with the grammar sym b o ls an d – semantic actions enclosed between braces {} are inserted within the right sides of productions the right sides of productions. • Ex: A → { }X{ }Y{ } ... } X { ... } Y { ... } S ti A ti CS308 Compiler Theory 6 Semantic A ctions
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有