Microsoft CCI - resources, references for writing compilers

好久不见. 提交于 2019-11-29 10:22:18

问题


Some time ago, I was working on compiler, I've used System.Reflection to generate code (IL) from my AST. Now, I've an idea for another compiler that I'd like to work on (it will be another pet project, nothing that will be used in production code, at least, not now).

As you know, pet projects have one big advantage over production code: you can experiment and fail. So, I've decided to try to write compiler using Microsoft's CCI.

The only good reference I've found is a sample compiler of basic language (that is a part of CCI on codeplex), but, I'd prefer to have some other resources, more like tutorials, books, articles, where I could get more information other than studying code (which isn't always the best method to learn something, as you see a solution, but you don't know what alternatives you have, or why such code works).

So: Do you have any resources (tutorials, books) about CCI, in context of writing compilers and handling AST?


回答1:


For the start, I'll throw few links, for those, who aren't familiar with CCI:

  1. CCI-AST project for generating and compiling abstract syntax trees.
  2. CCI-Metadata project for reading / writing meta data of clr assemblies, supports also reading / writing pdb.
  3. CCI-Samples project contains small basic compiler, which I was referring to in 1st post.
  4. Lang.Net presentation about CCI, a little "why and how?"
  5. VCC - concurrent c compiler, on top of CCI. I haven't dug into it yet, but I expect it to be another big project, without any explanations, not that good for learning constructing compilers from the beginning (beside this, it's mainly written in F#).


来源:https://stackoverflow.com/questions/1380380/microsoft-cci-resources-references-for-writing-compilers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!