Reputation: 262
I tried to parse some Java Code using the Java15 grammar of Rascal. However, it does not accept the declaration of local variable of parameterized types. In more details:
List<String> files = ...
final List<String> files = ...
List<String, String> files = ...
It seems to me that the problem is related to some ambiguity involving LocalVarDecStatements and expressions involving "<" and ">". However, I could not figure out how to fix the problem.
Upvotes: 1
Views: 155
Reputation: 6696
I'm not one to say "works for me", but it does :-) See:
rascal>import lang::java::\syntax::Java15;
ok
rascal>import ParseTree;
ok
rascal>parse(#LocalVarDec, "List\<String\> files = null")
LocalVarDec: (LocalVarDec) `List<String> files = null`
Could you provide the example or a simplified example which has the error in it?
Upvotes: 1