Search code examples
javaannotationsrascal

Rascal: Undeclared Annotation in std:///lang/java/flow/JavaToObjectFlow.rsc


In the following code snippet, I attempted to use the createOFG from JavaToObjectFlow.rsc:

void run(loc source) {
m = createM3FromEclipseProject(source);
set[Declaration] asts = createAstsFromEclipseProject(source, true);
FlowProgram p = createOFG(asts);
}

Upon executing this method, the following error was received:

|std:///lang/java/flow/JavaToObjectFlow.rsc|(4167,1,<153,26>,<153,27>): 
Undeclared annotation: decl on Expression
Advice: |http://tutor.rascal-
mpl.org/Errors/Static/UndeclaredAnnotation/UndeclaredAnnotation.html|

Since the error is coming from std:///lang/java/flow/JavaToObjectFlow.rsc and none of our fellow students receive the same error, I am wondering what is going wrong. The error occurs in both the stable and unstable versions of Rascal.


Solution

    1. you should be on unstable, as this message points to a known problem on stable.
    2. are you sure you get exactly the same message on unstable? in that case, please tell me what you see on that line (153 of file /lang/java/flow/JavaToObjectFlow.rsc)

    If you don't have a source location to click on to get you there, you can always browse the code from any rascal project:

    how to find the source code of rascal