Well, as a part of a dummy project Rahul and I are working currently, we need to create an Abstract Syntax Tree for the source code provided. Once that is done, we will be able to create wrapper classes around it and get our project running.
The AST that is provided by the core Java APIs give only a read-only handle, which is not of much use as we would like to be able to modify the AST later on. So we decided to go with the AST provided by Eclipse. Basically, eclipse has this thing integrated in its IDE to provide the refactoring features.
Importing a lot of eclipse jars, we set out to test if it works. The result is partial. We have been able to pass a source code as a string and get its AST, but when we tried passing the whole workspace, eclipse gave a run time error. It says IllegalStateException as the workspace is closed.
Googling around a bit, we realised that IWorkspace can be used only as an eclipse plugin. Now we certainly do not want to add the extra complexity of making an eclipse plugin, as we would like our code to run even in the absence of eclipse. So now, we need to figure out how to provide the whole workspace to the application as an input so that its AST can be generated.
Popularity: 2% [?]
No related posts.
