COINSを用いるためのコンパイラの自動生成の一方式

書誌事項

タイトル別名
  • COINS オ モチイル タメノ コンパイラ ノ ジドウ セイセイ ノ イチ ホウシキ
  • A Compiler Generation Method for Using COINS

この論文をさがす

抄録

コンパイラバックエンドの実装は,最適化や様々なCPU への対応などを考慮に入れると多大な労力がかかる.並列化コンパイラ向け共通インフラストラクチャCOINS は,容易にコンパイラを実装するための機能を提供している.COINS は手続き型言語を念頭において設計されており,手続き型言語の基本的な構造を採り入れた高レベルの中間表現HIR やよりマシンよりの低水準中間言語LIR,およびそれらを利用するためのAPI が用意されている.一方で,オブジェクト指向言語や関数型言語に採り入れられている機能,たとえば,クロージャ,クラスと継承など,モダンな言語が持つ機能のフロントエンドを作成し,COINS の提供する機能により,バックエンドを実装するのは容易ではない.我々は,COINS を用いてより容易にモダンな言語機能を実現するために,COINS の中間表現LIR をもとに,よりバックエンドの実装に適した機能を追加した新たな中間表現MIR を考案し,そのライブラリ・処理系を開発した.中間表現MIR は,マクロによる命令系の拡張が可能であり,この命令定義では対象言語に現れるオブジェクト構造の表現を支援するための機能を利用できるようにした.また,対象言語の構造を保ったまま,自然な形でスコープの管理を行うための検索スコープの指定記法を考案し,そのための記号表を実装した.以上の機能は,我々がこれまでに研究・開発した,入力記述を用途に合わせて拡張可能とする構文解析器生成系を用いてコンパイラを実装することを念頭として開発を行った.本論文では,これらのアイデアとその機能による効果について述べる.

It is not easy to implement a compiler backend, especially considering optimization and/or supporting various processors. COINS, A COmpiler INfra Structure, provides functions for implementing a compiler easily. COINS is basically designed for procedural languages. It provides high level intermediate language HIR, which can express the basic structure of procedural languages easily, and also provides APIs to deal with the HIR. However, it is not easy to implement the backend of a compiler of modern programming language that has ability of closure, class and inheritance, and/or etc with COINS. We have invented an intermediate representation MIR based on LIR, COINS’s Low-level Intermediate Representation, for implementing modern language features more easily with COINS. And we have developed the library and the processor for MIR. MIR is extensible by macro definitions. The macro expression is designed so that the target language’s object structure can be expressed easily. In addition, in order to management scope naturally, we have invented scope notation and have provided the symbol table library for using it. We have implemented the functions above for using with our extensible parser generator. It extends the input notation as usage. In this presentation, we describe these ideas and effects by these functions.

収録刊行物

参考文献 (17)*注記

もっと見る

キーワード

詳細情報 詳細情報について

問題の指摘

ページトップへ