I need to get the AST for the current selection in the java editor fo eclipse.
Basically I want to convert the selected java code in to some other form(maybe some other lang
IIRC, each node in the Eclipse AST contains an offset. All you need to do is to compute the offsets for the part of the code you are interested in then walk the AST to select the nodes within those offsets.