Ruben Ernst
Ruben Ernst

Reputation: 355

Read java comments with the M3 library

I would like to know how Rascal can read Java comments like this:

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

Or this:

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

The method createAstFromFile seems to skip these comments.

Thanks in advance.

Upvotes: 1

Views: 331

Answers (1)

Jurgen Vinju
Jurgen Vinju

Reputation: 6696

Comments are not included in the ASTs, but you can get the from the M3 model using @documentation field:

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

Upvotes: 3

Related Questions