1

我想知道 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 方法似乎跳过了这些注释。

提前致谢。

4

1 回答 1

3

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

anno rel[loc definition, loc comments] M3@documentation;
于 2014-04-24T06:20:48.697 回答