首页    期刊浏览 2024年11月26日 星期二
登录注册

文章基本信息

  • 标题:Type Checking C++ Template Instantiation by Graph Programs
  • 本地全文:下载
  • 作者:Karl Azab ; Karl-Heinz Pennemann
  • 期刊名称:Electronic Communications of the EASST
  • 电子版ISSN:1863-2122
  • 出版年度:2008
  • 卷号:10
  • 语种:English
  • 出版社:European Association of Software Science and Technology (EASST)
  • 摘要:Templates are a language feature of C++ and can be used for metaprogramming. The metaprogram is executed by the compiler and outputs source code which is then compiled. Templates are widely used in software libraries but few tools exist for programmers developing template code. In particular, error messages are often cryptic. During template instantiation, a compiler looks up names that depend on a template's formal parameters. We use graphs to represent the relevant parts of the source code and a graph program for the name lookup and type checking for expressions involving such names. This technique provides compiler writers with a visual way of writing algorithms that generate error messages and forms the basis for a visual inspection of type problems and suggested remedies for the programmer. Our graph program terminates and emits correct error messages.
国家哲学社会科学文献中心版权所有