Information and Media Technologies
Online ISSN : 1881-0896
ISSN-L : 1881-0896
Computing
A Transformation-Based Implementation of Lightweight Nested Functions
Tasuku HiraishiMasahiro YasugiTaiichi Yuasa
著者情報
ジャーナル フリー

2006 年 1 巻 2 号 p. 833-850

詳細
抄録
The SC language system was developed to provide a transformation-based language extension scheme for SC languages (extended/plain C languages with an S-expression-based syntax). Using this system, many flexible extensions to the C language can be implemented by means of transformation rules over S-expressions at low cost, mainly because of the preexisting Common Lisp capabilities for manipulating S-expressions. This paper presents the LW-SC (Lightweight-SC) language as an important application of this system, featuring nested functions (i.e., functions defined inside other functions). A function can manipulate its caller's local variables (or local variables of its indirect callers) by indirectly calling a nested function of its callers. Thus, many high-level services with “stack walk” can be easily and elegantly implemented by using LW-SC as an intermediate language. Moreover, such services can be implemented efficiently because we designed and implemented LW-SC to provide “lightweight” nested functions by aggressively reducing the costs of creating and maintaining nested functions. The GNU C compiler also provides nested functions as an extension to C, but our sophisticated translator to standard C is more portable and efficient for occasional “stack walk.”
著者関連情報
© 2006 by Information Processing Society of Japan
前の記事 次の記事
feedback
Top