首页 | 本学科首页   官方微博 | 高级检索  
     


Reusable specification modules for type analysis
Authors:Uwe Kastens  William M Waite
Abstract:Type analysis can be characterized by a language‐independent collection of standard computational roles such as ‘typed identifier use’ (e.g. a variable name appearing in an expression) and ‘dyadic expression’ (e.g. addition of two values). A type analyzer for a specific language is then defined by stating which language construct(s) play each role. The computational roles provide a framework for understanding the general process and a vocabulary for applying that understanding to the solution of particular problems. We have captured this knowledge in attribute grammar modules that are carefully designed to be combinable and adaptable, exporting language‐independent roles that define the general type analysis problem. From this collection, the compiler designer instantiates the appropriate modules and identifies the relevant source‐language constructs; an attribute grammar processor then weaves the necessary computations into the compiler's semantic analyzer. Our attribute grammar modules provide a precise definition of the actions constituting the various roles and the dependences among them. They can therefore also be used to describe the type analysis process to students, or to specify a hand‐coded semantic analyzer. Copyright © 2009 John Wiley & Sons, Ltd.
Keywords:compilers  type analysis  attribute grammars  reuse
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号