使用M3库读取Java注释

时间:2014-04-23 08:11:26

标签: rascal

我想知道Rascal如何阅读这样的Java评论:

//This intent is used to share the picture between Android applications
Intent shareIntent = new Intent();

或者这个:

/**
 * This method can be called to share the picture between Android Applications
 */
private void shareImage() {
    ...
}

createAstFromFile方法似乎跳过了这些评论。

提前致谢。

1 个答案:

答案 0 :(得分:2)

注释不包含在AST中,但您可以使用@documentation字段从M3模型中获取:

anno rel[loc definition, loc comments] M3@documentation;