Hi All,
I'm trying to develop a plugin for Eclipse to generate code for one of our internal framework. As you can see I'm trying to create an AST parser for a Type which is dynamically identified.
private void parse(Vector categories,ICompilationUnit icompUnit) {
ASTParser parser1 = ASTParser.newParser(AST.JLS4);
IJavaProject project = icompUnit.getJavaProject();
parser1.setKind(ASTParser.K_COMPILATION_UNIT);
Document doc= null;
try {
doc = new Document(icompUnit.getSource());
} catch (JavaModelException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
parser1.setProject(project);
parser1.setSource(doc.get().toCharArray());
parser1.setResolveBindings(true);
parser1.setBindingsRecovery(true);
parser1.setStatementsRecovery(true);
CompilationUnit parsedUnit =
(CompilationUnit)parser1.createAST(null);
parsedUnit.accept(new FVisitor(parsedUnit,categories));
}
But in the visitor (MyVisitor),
public boolean visit(VariableDeclarationFragment node) {
.............................
node.resolveBinding();
.............................
}
node.resolveBinding()is returning null.
Please help me to solve this issue by giving some pointers.
San
[Updated on: Tue, 25 September 2012 13:51]
Report message to a moderator