문제

I am using Rascal to analyze an Eclipse project and I was wondering if it is possible to detect whether a certain field is declared as static, like static int x;.

I have created an M3 model for my project and using fields(model) I can obtain all the fields that are present within my project.

I would like to be able to extract any static fields from this set (without having to check the original code myself).

Is this possible within Rascal and if so, how can I extract them?

도움이 되었습니까?

해결책

Take a look at the modifiers relation.

Inside Rascal you can find the definition of Modifier in rascal > lang > java > m3 > AST.rsc (also included in the tutor at: http://tutor.rascal-mpl.org/Rascal/Libraries/lang/java/m3/AST/Declaration/Declaration.html )

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top