2

I'm working on a new toy language that will be statically compiled to .NET's IL code.

Off hand I can think of the following to actually generate the IL, but I'm open to alternatives:

  • Cecil
  • ILASM
4

3 に答える 3

2

CommonCompilerインフラストラクチャ(AST /コードメタデータ)、そしてもちろん由緒あるReflection.Emitもあります。私自身はCCIの経験はありませんが、このページはIL翻訳の面での良い出発点のようです。

于 2009-12-30T22:28:18.603 に答える
1

You can write your own language using this compiler generator. I used it. Its really easy to use and to understand.

CoCo/R

http://en.wikipedia.org/wiki/Coco/R

于 2009-12-30T21:54:50.527 に答える
0

MSILの生成自体が重要でない場合は、言語をC#に「コンパイル」(変換)してから、通常のdotnetコンパイラを使用できます。難解なパフォーマンスの最適化などを実装する余地はあまりありませんが、それはかなり簡単だと思います。コンパイル速度の最適化に関心がなかったこのような新しい言語の状況では、一般的な高級言語への翻訳が間違いなく私の最初の選択肢でした。

于 2011-04-07T17:24:25.547 に答える