@article{oai:ipsj.ixsq.nii.ac.jp:00016661, author = {住井英二郎 and 大根田裕一 and 米澤, 明憲 and Eijiro, Sumii and Yuichi, Oneda and Akinori, Yonezawa}, issue = {SIG12(PRO23)}, journal = {情報処理学会論文誌プログラミング(PRO)}, month = {Nov}, note = {制御フローグラフに類似した一般的な命令型言語を,CPS(継続渡しスタイル)を中間表現としてコンパイルする方法を提案する.CPS とは,「残りの計算」(継続と呼ばれる)を表現する関数を生成することにより,すべての関数呼び出しや条件分岐を末尾位置においた関数型言語の一種であり,Scheme やML といった関数型言語のコンパイラに広く用いられている.命令型言語をCPS に変換することで,スタックフレームや例外ハンドラが継続として明示化され,関数適用や例外処理における複雑な制御の流れが明確化される.結果として,インライン展開や末尾呼び出し最適化を含む多くの最適化が容易に実現できる.我々は命令型言語をCPS に変換する過程の単純な定式化を与え,その正しさを証明する., We propose a method of compiling a generic imperative language (similar to control flow graphs) by using CPS (continuation passing style) as an intermediate representation. CPS is a form of functional programs that puts all function calls and all conditional branches into tail positions by generating functions to represent “the rest of the computation” (called continuations). It is widely used as an intermediate representation in compilers of functional languages such as Scheme and ML. By translating an imperative language into CPS, complicated control flow as in function application and exception handling is clarified because activation records and exception handlers are made explicit as continuations. As a result, many optimizations including inline expansion and tail-call optimization can be easily implemented. We give a simple formulation to the process of converting the imperative language into CPS and prove its correctness.}, pages = {67--82}, title = {例外処理機構を備えた命令型言語のCPS変換とその定式化}, volume = {45}, year = {2004} }